[go-nuts] Re: The last line makes the variable y escape. But should it?

2021-06-02 Thread tapi...@gmail.com
I think I got the reason. It is because the compiler is not aware of the println will not change the value of y. And it is hard or expensive for the compiler to understand the channel synchronization. If the println function changes y, then y must be allocated on heap. On Tuesday, June 1,

Re: [go-nuts] Re: The last line makes the variable y escape. But should it?

2021-06-02 Thread cheng dong
`y` escape because the println use interface{} as its parameter, golang can't know in compiling time what this parameter could be use (to be copy to global or send to other goroutine). so it is the interface self make golang hard to keep variable in stack On Wednesday, June 2, 2021 at 1:30:49

Re: [go-nuts] Re: The last line makes the variable y escape. But should it?

2021-06-02 Thread Jan Mercl
On Wed, Jun 2, 2021 at 8:48 AM cheng dong wrote: > `y` escape because the println use interface{} as its parameter, println is a bootstrap function that the compiler knows about by itself. It's formal/pseudo signature does not use 'interface{}'. I haven't checked the actual implementation, but

[go-nuts] Re: embedding files in tests

2021-06-02 Thread Manlio Perillo
Here is an example: https://play.golang.org/p/ElnTtxHnF5I The output of `go list -json ./pkg` only reports `TestEmbedPatterns`. The output of `go list -json -test ./pkg` reports TestEmbedFiles for the pkg package (it seems a bug, since it should also be reported without the -test flag). The

[go-nuts] Re: json unmarshalling troubles

2021-06-02 Thread Robert Glonek
The json is not very strict, while go is. It would be good if the json struct could potentially be strictly of same type all over the place. Implementing parser for this json in any language will be a bit of a pain with some try/except... If you really need to do so, you would need to have the

[go-nuts] Re: json unmarshalling troubles

2021-06-02 Thread Robert Glonek
Here's a quick-glued reflect example. https://play.golang.org/p/blpmIVKhuc4 If you try using switch value.(type) instead of using reflect, bool will be reported as int, fyi, so using reflect here. On Wednesday, 2 June 2021 at 16:02:36 UTC+1 Robert Glonek wrote: > The json is not very strict,

[go-nuts] Re: json unmarshalling troubles

2021-06-02 Thread Brian Candler
> If you try using switch value.(type) instead of using reflect, bool will be reported as int, fyi, so using reflect here. Could you explain that a bit further please? A type switch seems to work OK for me, with no reflect. https://play.golang.org/p/TBH5zKYnG4G -- You received this message

[go-nuts] Re: embedding files in tests

2021-06-02 Thread peterGo
"it seems a bug ... it should" Why? Why perform unnecessary disk directory I/O for a build to discover which files satisfy the patterns for a test? Go tools are expected to be fast. Peter On Wednesday, June 2, 2021 at 5:49:41 AM UTC-4 manlio@gmail.com wrote: > Here is an example:

[go-nuts] Re: How is golang web applications for seo

2021-06-02 Thread Volker Dobler
On Tuesday, 1 June 2021 at 18:39:48 UTC+2 beeke...@gmail.com wrote: > How are golang web applications on a scale of 1 to 10 for seo rankings? They range from 1 to 10 depending on how they are implemented. SEO ranking is not influenced by the language you write your "web application" in. V.

[go-nuts] json unmarshalling troubles

2021-06-02 Thread natxo....@gmail.com
hi, I have this json back from an api: { "all_parameters": [{ "priority": 60, "created_at": "2021-06-02 12:15:13 UTC", "updated_at": "2021-06-02 12:15:13 UTC", "id": 28, "name": "network_interface_mapping",

[go-nuts] Hiring - Remote / Denver (GoLang)

2021-06-02 Thread William Theis
Hi everyone, I'm the Head of Technical Recruiting for Fluid Truck, and we're hiring multiple GoLang backend engineers currently. This is a full-time role, preferably in Denver but can be remote (US based), offering very competitive base salaries + stock options, 100% medical benefits

[go-nuts] Re: Hiring - Remote / Denver (GoLang)

2021-06-02 Thread Advay Rajhansa
Can you sponsor US visa? I can consider base salary negotiation if that is possible. On Wednesday, 2 June 2021 at 23:21:35 UTC+5:30 wth...@fluidtruck.com wrote: > Hi everyone, > > I'm the Head of Technical Recruiting for Fluid Truck, and we're hiring > multiple GoLang backend engineers

Re: [go-nuts] LD_LIBRARY_PATH is required when bootstrapping Go with gccgo (non-standard location)

2021-06-02 Thread Ian Lance Taylor
On Sun, May 23, 2021 at 3:57 AM Bagas Sanjaya wrote: > > Today I have built GCC 11.1.0 for use to bootstrap Go using gccgo. > I installed GCC to non-standard path, that is inside my home directory > (~/.ct-ng/tools/gcc-11.1.10) (sorry for typo when building GCC, I > meant gcc-11.1.0). > > `gcc

[go-nuts] Re: json unmarshalling troubles

2021-06-02 Thread Amnon
No, whoever designed the schema of this API has lost their marbles, (or lacks any kind of consideration for the unfortunate souls who need to use this API). Unmarshalling a value whose type is not fixed is a pain in Go. But handling a value of unknown type will be a headache in any language.

[go-nuts] Re: json unmarshalling troubles

2021-06-02 Thread Robert Glonek
I think I'm loosing my marbles. Nevermind what I said. On Wednesday, 2 June 2021 at 16:22:34 UTC+1 Brian Candler wrote: > > If you try using switch value.(type) instead of using reflect, bool will > be reported as int, fyi, so using reflect here. > > Could you explain that a bit further please?