[go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Space A.
Hi,

the solution would be:

1. Protect WASM source files with build flags so that when you open a 
"backend" main sources, IDE won't complain about "syscall/js", like this:
// +build js,wasm
2. Open `wasm` directory in second instance of VS Code for which you would 
set GOOS and GOARCH for a workspace. When editing settings in json, click 
on "workspace" tab and VS Code will create .vscode/settings.json in `wasm` 
directory. Put something like:
{
"go.toolsEnvVars": {
"GOOS": "js",
"GOARCH": "wasm",
}
}
in there.
3. In future, work in two instances of VS Code, even though if logically 
it's a different parts of same project and could be under the same Go 
module. All IDE features will work fluently. I haven't seen any problems 
with this approach so far.


суббота, 13 февраля 2021 г. в 23:42:06 UTC+3, michael...@gmail.com: 

> *(Sorry for posting what is mostly a VSCode question. I've asked it on 
> StackOverflow without getting any responses.  Am reposting here in the hope 
> that some has already run into this problem and figured out how to deal 
> with it.)*
>
> I have a Go project that builds a WebAssembly (WASM)  app and a backend 
> server for it. Both pieces build and run without errors. VSCode, however, 
> produces an annoying linter error in the WASM app.
>
> ```
> could not import syscall/js (no required module provides package 
> "syscall/js")
> ```
>
> The problem, as I currently understand it, is that VSCode doesn't infer 
> from the build tags that it should invoke `gopls` with `env GOOS=js 
> GOARCH=wasm` and that one solution is to set these tags as workspace Go 
> environment vars.
>
> The app design, however, relies on providing a common internal package to 
> both the wasm and the server code so that each side sees some struct 
> definitions that simplify the interface between them. To that end, the repo 
> is organized (simplified view) as follows:
>
> ```
> cmd
> ├── internal
> │   └── common
> │   ├── common.go
> │   └── common_test.go
> ├── server
> │   └── main.go
> └── wasm
> └── main.go
> ```
>
> How can I configure VSCode to use `env GOOS=js GOARCH=wasm` when linting 
> the wasm directory and not for other directories? 
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ed6caf0c-64ec-454d-8926-dc9cbb98d8a5n%40googlegroups.com.


Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
Thanks, Space & Alex.  I already understood the need for the Go tool
environment vars, just didn't know how to apply them on a per-folder
basis.  Thanks for outlining how to use multiple instances of VSCode.  It
doesn't appeal to my workflow preferences, but then *à chacun son goût* as *nos
amis français* would put it.

I ended up learning how to use VSCode Multi-Root Workspaces to permit a
separate settings.json in wasm/ folder.  That seems to work fairly well.  I
wrote a detailed answer on StackOverflow

for
anyone who's interested.

Cheers,
Mike

*“I want you to act as if the house was on fire. Because it is.” — Greta
Thunberg*


On Sun, Feb 14, 2021 at 7:11 AM Space A.  wrote:

> Hi,
>
> the solution would be:
>
> 1. Protect WASM source files with build flags so that when you open a
> "backend" main sources, IDE won't complain about "syscall/js", like this:
> // +build js,wasm
> 2. Open `wasm` directory in second instance of VS Code for which you would
> set GOOS and GOARCH for a workspace. When editing settings in json, click
> on "workspace" tab and VS Code will create .vscode/settings.json in `wasm`
> directory. Put something like:
> {
> "go.toolsEnvVars": {
> "GOOS": "js",
> "GOARCH": "wasm",
> }
> }
> in there.
> 3. In future, work in two instances of VS Code, even though if logically
> it's a different parts of same project and could be under the same Go
> module. All IDE features will work fluently. I haven't seen any problems
> with this approach so far.
>
>
> суббота, 13 февраля 2021 г. в 23:42:06 UTC+3, michael...@gmail.com:
>
>> *(Sorry for posting what is mostly a VSCode question. I've asked it on
>> StackOverflow without getting any responses.  Am reposting here in the hope
>> that some has already run into this problem and figured out how to deal
>> with it.)*
>>
>> I have a Go project that builds a WebAssembly (WASM)  app and a backend
>> server for it. Both pieces build and run without errors. VSCode, however,
>> produces an annoying linter error in the WASM app.
>>
>> ```
>> could not import syscall/js (no required module provides package
>> "syscall/js")
>> ```
>>
>> The problem, as I currently understand it, is that VSCode doesn't infer
>> from the build tags that it should invoke `gopls` with `env GOOS=js
>> GOARCH=wasm` and that one solution is to set these tags as workspace Go
>> environment vars.
>>
>> The app design, however, relies on providing a common internal package to
>> both the wasm and the server code so that each side sees some struct
>> definitions that simplify the interface between them. To that end, the repo
>> is organized (simplified view) as follows:
>>
>> ```
>> cmd
>> ├── internal
>> │   └── common
>> │   ├── common.go
>> │   └── common_test.go
>> ├── server
>> │   └── main.go
>> └── wasm
>> └── main.go
>> ```
>>
>> How can I configure VSCode to use `env GOOS=js GOARCH=wasm` when linting
>> the wasm directory and not for other directories?
>>
>>
>>
>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/2vI1CA76HPI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/ed6caf0c-64ec-454d-8926-dc9cbb98d8a5n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAK6kDbabC5Wh9XoFBnFGzKZZ6Ect1--xPwkPpSXDEUboarm0QQ%40mail.gmail.com.


Re: [go-nuts] Error handling

2021-02-14 Thread Wojciech S. Czarnecki
Dnia 2021-02-13, o godz. 17:44:47
Michael MacInnis  napisał(a):

> I've been playing around with reducing error handling boilerplate

You're not alone. Hundreds of us went into such thinking in the first weeks
of reading/using Go - yet before we noticed how much more productive we
are with Go's "boilerplate" than we were in languages where handling errors
(failures) was "a problem of others", including future-us as "others".

Perceived consensus of the Go community is that "error handling boilerplate"
is a strong feature. I.e. in normal production software you MUST handle failures
and you should do it as close as possible to the source of said failure.

Go helps with that. Even team's proposal was finally retracted:
https://github.com/golang/go/issues/32437 Discussion there is lengthy, but worth
reading to sense why wider community considers "boilerplate" as asset.

Error handling proposals umbrella: https://github.com/golang/go/issues/40432

> Michael.

Hope this helps,

-- 
Wojciech S. Czarnecki
 << ^oo^ >> OHIR-RIPE

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20210214171250.4377c454%40xmint.


Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Wojciech S. Czarnecki
Dnia 2021-02-14, o godz. 10:54:02
Michael Ellis  napisał(a):

> I wrote a detailed answer on StackOverflow

Thank you.

As vscode-go is now curated by the Go team [https://blog.golang.org/vscode-go]
I think you should raise issue at https://github.com/golang/vscode-go. 
Your project layout (original one) seems good and straightforward, and the need
for having per-folder environment settings or build-tags is real.
It shouldn't be the IDE that dictates Go project structure, IMO.

TC,

-- 
Wojciech S. Czarnecki
 << ^oo^ >> OHIR-RIPE

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20210214173156.1a9edbfa%40xmint.


Re: [go-nuts] Error handling

2021-02-14 Thread robert engels
I think ’strong census’ is not accurate - thus the discussions around improving 
error handling in Go2.

Many have commented here and elsewhere that the number one reason they don’t 
use Go is due to lack of exception handling.

> On Feb 14, 2021, at 10:12 AM, Wojciech S. Czarnecki  wrote:
> 
> Dnia 2021-02-13, o godz. 17:44:47
> Michael MacInnis  napisał(a):
> 
>> I've been playing around with reducing error handling boilerplate
> 
> You're not alone. Hundreds of us went into such thinking in the first weeks
> of reading/using Go - yet before we noticed how much more productive we
> are with Go's "boilerplate" than we were in languages where handling errors
> (failures) was "a problem of others", including future-us as "others".
> 
> Perceived consensus of the Go community is that "error handling boilerplate"
> is a strong feature. I.e. in normal production software you MUST handle 
> failures
> and you should do it as close as possible to the source of said failure.
> 
> Go helps with that. Even team's proposal was finally retracted:
> https://github.com/golang/go/issues/32437 Discussion there is lengthy, but 
> worth
> reading to sense why wider community considers "boilerplate" as asset.
> 
> Error handling proposals umbrella: https://github.com/golang/go/issues/40432
> 
>> Michael.
> 
> Hope this helps,
> 
> -- 
> Wojciech S. Czarnecki
> << ^oo^ >> OHIR-RIPE
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/20210214171250.4377c454%40xmint.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/B2B2509D-8FD5-4F3D-B469-080E3498D5F1%40ix.netcom.com.


Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
>
> As vscode-go is now curated by the Go team [
> https://blog.golang.org/vscode-go]
> I think you should raise issue at https://github.com/golang/vscode-go.
> Your project layout (original one) seems good and straightforward, and the
> need
> for having per-folder environment settings or build-tags is real.
> It shouldn't be the IDE that dictates Go project structure, IMO.
>

I agree about wanting project structure independent of IDE.  I'm not so
sure if this is something vscode-go can reasonably be expected to solve,
though.

If I'm understanding correctly,  vscode-go would need to parse each file
for build-tags and pass that information to the go tool chain, presumably
as environment variables.

That sounds doable for standard tags that map to supported values for GOOS,
GOARCH, etc., but I wonder what problems would be caused by non-standard
tags, e.g. "+build mage" for magefiles.


Cheers,
Mike

*“I want you to act as if the house was on fire. Because it is.” — Greta
Thunberg*


On Sun, Feb 14, 2021 at 11:32 AM Wojciech S. Czarnecki 
wrote:

> Dnia 2021-02-14, o godz. 10:54:02
> Michael Ellis  napisał(a):
>
> > I wrote a detailed answer on StackOverflow
>
> Thank you.
>
> As vscode-go is now curated by the Go team [
> https://blog.golang.org/vscode-go]
> I think you should raise issue at https://github.com/golang/vscode-go.
> Your project layout (original one) seems good and straightforward, and the
> need
> for having per-folder environment settings or build-tags is real.
> It shouldn't be the IDE that dictates Go project structure, IMO.
>
> TC,
>
> --
> Wojciech S. Czarnecki
>  << ^oo^ >> OHIR-RIPE
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/2vI1CA76HPI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/20210214173156.1a9edbfa%40xmint
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAK6kDbZ8E7py6hX_8Bp7Z-gixoZg6MNeJzZy00Vr0y4zoBhyow%40mail.gmail.com.


Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
I've opened https://github.com/golang/vscode-go/issues/1225.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAK6kDbZXw1HRs5tqX50LFfv%3Dg_drosjMXbN13_ELD5pYCyt8bQ%40mail.gmail.com.


[go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread Santhosh Kumar T
I created:
one instance using big.NewFloat function
another instance using big.Float.SetString method

when compared both these instances using big.Float.Cmp, it return non-zero

code: https://play.golang.org/p/NhQ-klcph2z

am I doing something wrong ?
can some one explain why Cmp returns non-zero ?

thanks
Santhosh


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/82e16a17-387e-41cb-a79c-723c2e8a772bn%40googlegroups.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread Kurtis Rader
The value 123.4 cannot be represented exactly as a float64. See
https://golang.org/pkg/math/big/#NewFloat for the caveats involved in using
NewFloat() or SetFloat64(). Passing a string representation allows the
implementation to preserve the exact value without rounding.

On Sun, Feb 14, 2021 at 12:21 PM Santhosh Kumar T 
wrote:

> I created:
> one instance using big.NewFloat function
> another instance using big.Float.SetString method
>
> when compared both these instances using big.Float.Cmp, it return non-zero
>
> code: https://play.golang.org/p/NhQ-klcph2z
>
> am I doing something wrong ?
> can some one explain why Cmp returns non-zero ?
>
> thanks
> Santhosh
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/82e16a17-387e-41cb-a79c-723c2e8a772bn%40googlegroups.com
> 
> .
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD_vNfJu79roUazSatzVG9%3DQvB5WZ9w-sksxEppa8sY-tg%40mail.gmail.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread Santhosh Kumar T
When I print both values, they print exactly same. so I am assuming no 
precision lost for this specific example 123.4.
but still Cmp returns non-zero.

---
Santhosh

On Monday, February 15, 2021 at 2:03:24 AM UTC+5:30 Kurtis Rader wrote:

> The value 123.4 cannot be represented exactly as a float64. See 
> https://golang.org/pkg/math/big/#NewFloat for the caveats involved in 
> using NewFloat() or SetFloat64(). Passing a string representation allows 
> the implementation to preserve the exact value without rounding.
>
> On Sun, Feb 14, 2021 at 12:21 PM Santhosh Kumar T  
> wrote:
>
>> I created:
>> one instance using big.NewFloat function
>> another instance using big.Float.SetString method
>>
>> when compared both these instances using big.Float.Cmp, it return non-zero
>>
>> code: https://play.golang.org/p/NhQ-klcph2z
>>
>> am I doing something wrong ?
>> can some one explain why Cmp returns non-zero ?
>>
>> thanks
>> Santhosh
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/82e16a17-387e-41cb-a79c-723c2e8a772bn%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/62f0afbd-31d3-42db-b967-9a6b5b77d838n%40googlegroups.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2021-02-14 at 13:19 -0800, Santhosh Kumar T wrote:
> When I print both values, they print exactly same. so I am assuming
> no precision lost for this specific example 123.4.
> but still Cmp returns non-zero.

This is not a good assumption to make, and is refuted by the result of
Cmp.

https://play.golang.org/p/ROr6cHMzWIf




-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5635a54d86152c7617fdb05c9fe8b94b2040c9e0.camel%40kortschak.io.


[go-nuts] Re: Go based xml manipulation library

2021-02-14 Thread Santhosh Kumar T
You can try https://github.com/santhosh-tekuri/xpath. it uses 
https://github.com/santhosh-tekuri/xpath as model.

BTW, I am author of the above projects

- santhosh

On Friday, February 12, 2021 at 10:30:57 PM UTC+5:30 sunto...@gmail.com 
wrote:

> Thanks Steve, 
>
> That's what I thought, but on taking a closer look, especially the getting 
> to the `following-sibling` part, I didn't find any API that I can make use 
> of out of the box. Hence --
>
> https://github.com/beevik/etree/issues/99
>
> Could you elaborate on how to get to the `following-sibling` part of a 
> given element for etree please? Using 
> http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis as 
> the example, in either place will do. thx
>
>
> On Thursday, February 11, 2021 at 7:17:40 PM UTC-5 st...@rothskeller.net 
> wrote:
>
>> github.com/beevik/etree does much of what you're looking for.
>> Steve
>>
>> On Thursday, February 11, 2021 at 1:10:51 PM UTC-8 sunto...@gmail.com 
>> wrote:
>>
>>> Is there any Go library that allow certain following-sibling 
>>>  manipulation?
>>>
>>> Specifically, I want to,
>>>
>>>- locate an xml node via XPath
>>>- delete its following-sibling
>>>
>>> More or less like this, 
>>> http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis, 
>>> but to delete the node, instead of just locating it.
>>>
>>> thx
>>>
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e3ad6d21-07aa-41c7-93d1-f68d50018645n%40googlegroups.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread Kurtis Rader
On Sun, Feb 14, 2021 at 1:19 PM Santhosh Kumar T 
wrote:

> When I print both values, they print exactly same. so I am assuming no
> precision lost for this specific example 123.4.
> but still Cmp returns non-zero.
>

As Dan pointed out, that is an invalid assumption. The code that formats a
float (whether big or float64) as a string is aware that the IEEE 754
binary format for floats cannot represent most values exactly and
compensates accordingly. That way you get "3.5" rather than
"3.499" for example.


> On Monday, February 15, 2021 at 2:03:24 AM UTC+5:30 Kurtis Rader wrote:
>
>> The value 123.4 cannot be represented exactly as a float64. See
>> https://golang.org/pkg/math/big/#NewFloat for the caveats involved in
>> using NewFloat() or SetFloat64(). Passing a string representation allows
>> the implementation to preserve the exact value without rounding.
>>
>> On Sun, Feb 14, 2021 at 12:21 PM Santhosh Kumar T 
>> wrote:
>>
>>> I created:
>>> one instance using big.NewFloat function
>>> another instance using big.Float.SetString method
>>>
>>> when compared both these instances using big.Float.Cmp, it return
>>> non-zero
>>>
>>> code: https://play.golang.org/p/NhQ-klcph2z
>>>
>>> am I doing something wrong ?
>>> can some one explain why Cmp returns non-zero ?
>>>
>>
-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD8eK8XRfbKmN2oKi2RCv2FkLc2ML8BdqCzC3DxbL7cm-A%40mail.gmail.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread Santhosh Kumar T
now I understand it. why they are not same

but why f2 printed as 123.4139
f2 is constructed using SetString method, so it should be accurate and 
printed as 123.4000.

- Santhosh

On Monday, February 15, 2021 at 2:53:45 AM UTC+5:30 kortschak wrote:

> On Sun, 2021-02-14 at 13:19 -0800, Santhosh Kumar T wrote:
> > When I print both values, they print exactly same. so I am assuming
> > no precision lost for this specific example 123.4.
> > but still Cmp returns non-zero.
>
> This is not a good assumption to make, and is refuted by the result of
> Cmp.
>
> https://play.golang.org/p/ROr6cHMzWIf
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b6a82206-6660-4a08-85bd-86e482b8527en%40googlegroups.com.


Re: [go-nuts] What compatibility of go/ast, go/types, go/packages packages is planned, if any, when transitioning toward go2 ?

2021-02-14 Thread Michael Ellis
On Wednesday, 27 January 2021 at 23:28:17 UTC+1 Ian Lance Taylor wrote:
To be clear, there is no Go 2, and there are no plans for Go 2.

Speaking as one who suffered through the ill-conceived and interminable 
Python3 transition, this is the best news I've heard since discovering and 
falling in love (well, it *is* Valentines Day) with Go a couple of years 
ago.  Thank you!

On Thursday, January 28, 2021 at 2:26:37 PM UTC-5 Ian Lance Taylor wrote:

> On Thu, Jan 28, 2021 at 3:43 AM 'Carla Pfaff' via golang-nuts
>  wrote:
> >
> > On Wednesday, 27 January 2021 at 23:28:17 UTC+1 Ian Lance Taylor wrote:
> >>
> >> To be clear, there is no Go 2, and there are no plans for Go 2.
> >
> >
> > For someone who follows the mailing lists and issue comments this has 
> been known for a while, but it's easy to see where the confusion comes 
> from, given these blog posts:
> >
> > https://blog.golang.org/toward-go2
> > https://blog.golang.org/go2-here-we-come
> > https://blog.golang.org/go2-next-steps
> >
> > They mention backward-compatibility, but only for the initial proposals 
> "to get the ball rolling". There hasn't been a blog post titled "There are 
> no plans for Go 2" or "Go 2 is not what you think it is" so far. The 
> current policy seems to be this document:
> >
> > "Proposal: Go 2 transition": 
> https://go.googlesource.com/proposal/+/refs/heads/master/design/28221-go2-transitions.md
> > "If the above process works as planned, then in an important sense there 
> never will be a Go 2."
> >
> > It is labeled "Proposal", but it doesn't seem to be a proposal in the 
> usual proposal process sense, and many may have missed it.
>
> You're right, I wrote that poorly. People use "Go 2" in various
> different ways. I should have said: there is no plan to ever break
> backward compatibility with earlier versions of Go.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/77ade682-6cb2-45ee-b7bd-7447d3b41a7dn%40googlegroups.com.


Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Kevin Chadwick
> In future, work in two instances of VS Code

I set GOOS env variable and HISTFILE env variable on each code execution. So a 
particular folder is tied to that OS and the terminal history is separate.

IOW, i make a code app icon for each current project. One also for go stdlib 
src searches.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/B31821FA-8443-4102-A235-7440C49CB27E%40gmail.com.


Re: [go-nuts] big.Float.Cmp does not work as expected

2021-02-14 Thread 'Dan Kortschak' via golang-nuts
You can set your precision arbitrarily high, but you will still find a
point at which there are non-zero decimal digits.

https://play.golang.org/p/JYcAvXQPfeO

123.4 cannot be represented in binary with a finite number of bits.

On Sun, 2021-02-14 at 13:33 -0800, Santhosh Kumar T wrote:
> now I understand it. why they are not same
> 
> but why f2 printed as 123.4139
> f2 is constructed using SetString method, so it should be accurate
> and printed as 123.4000.


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7e80e8d2a324824f0c987ecc8fe0441cc70877d7.camel%40kortschak.io.


Re: [go-nuts] Re: Go based xml manipulation library

2021-02-14 Thread Tong Sun
Thank you Santhosh!

Can the https://github.com/santhosh-tekuri/xpath model edit or delete
elements, apart from locating them?
If so, are there any ready-made examples/blogs etc that I can refer to?

Thx!

On Sun, Feb 14, 2021 at 4:28 PM Santhosh Kumar T
 wrote:
>
> You can try https://github.com/santhosh-tekuri/xpath. it uses 
> https://github.com/santhosh-tekuri/xpath as model.
>
> BTW, I am author of the above projects
>
> - santhosh
>
> On Friday, February 12, 2021 at 10:30:57 PM UTC+5:30 sunto...@gmail.com wrote:
>>
>> Thanks Steve,
>>
>> That's what I thought, but on taking a closer look, especially the getting 
>> to the `following-sibling` part, I didn't find any API that I can make use 
>> of out of the box. Hence --
>>
>> https://github.com/beevik/etree/issues/99
>>
>> Could you elaborate on how to get to the `following-sibling` part of a given 
>> element for etree please? Using 
>> http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis as the 
>> example, in either place will do. thx
>>
>>
>> On Thursday, February 11, 2021 at 7:17:40 PM UTC-5 st...@rothskeller.net 
>> wrote:
>>>
>>> github.com/beevik/etree does much of what you're looking for.
>>> Steve
>>>
>>> On Thursday, February 11, 2021 at 1:10:51 PM UTC-8 sunto...@gmail.com wrote:

 Is there any Go library that allow certain following-sibling manipulation?

 Specifically, I want to,

 locate an xml node via XPath
 delete its following-sibling

 More or less like this, 
 http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis, but 
 to delete the node, instead of just locating it.

 thx



> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "golang-nuts" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/golang-nuts/X_Di8cLEncU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/e3ad6d21-07aa-41c7-93d1-f68d50018645n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMmz1OciDvUrkeSzVCbXpC37e1ecMkpMOfhxfinReQxcaD7_dw%40mail.gmail.com.


Re: [go-nuts] Re: Go based xml manipulation library

2021-02-14 Thread Santhosh T
the dom model, currently only provides Append method.
but the all members of model are exported. so it should
be possible to write delete by removing node from slice and
setting its parent to null.

- santhosh

On Mon, Feb 15, 2021 at 5:00 AM Tong Sun  wrote:

> Thank you Santhosh!
>
> Can the https://github.com/santhosh-tekuri/xpath model edit or delete
> elements, apart from locating them?
> If so, are there any ready-made examples/blogs etc that I can refer to?
>
> Thx!
>
> On Sun, Feb 14, 2021 at 4:28 PM Santhosh Kumar T
>  wrote:
> >
> > You can try https://github.com/santhosh-tekuri/xpath. it uses
> https://github.com/santhosh-tekuri/xpath as model.
> >
> > BTW, I am author of the above projects
> >
> > - santhosh
> >
> > On Friday, February 12, 2021 at 10:30:57 PM UTC+5:30 sunto...@gmail.com
> wrote:
> >>
> >> Thanks Steve,
> >>
> >> That's what I thought, but on taking a closer look, especially the
> getting to the `following-sibling` part, I didn't find any API that I can
> make use of out of the box. Hence --
> >>
> >> https://github.com/beevik/etree/issues/99
> >>
> >> Could you elaborate on how to get to the `following-sibling` part of a
> given element for etree please? Using
> http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis as
> the example, in either place will do. thx
> >>
> >>
> >> On Thursday, February 11, 2021 at 7:17:40 PM UTC-5
> st...@rothskeller.net wrote:
> >>>
> >>> github.com/beevik/etree does much of what you're looking for.
> >>> Steve
> >>>
> >>> On Thursday, February 11, 2021 at 1:10:51 PM UTC-8 sunto...@gmail.com
> wrote:
> 
>  Is there any Go library that allow certain following-sibling
> manipulation?
> 
>  Specifically, I want to,
> 
>  locate an xml node via XPath
>  delete its following-sibling
> 
>  More or less like this,
> http://zvon.org/comp/r/tut-XPath_1.html#Pages~Following-sibling_axis, but
> to delete the node, instead of just locating it.
> 
>  thx
> 
> 
> 
> > --
> > You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/X_Di8cLEncU/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/e3ad6d21-07aa-41c7-93d1-f68d50018645n%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABv5LKX4HEL-wRd20kx44xkZvgYEwri59sQxW6GocYq5HXyieg%40mail.gmail.com.