Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread 'Axel Wagner' via golang-nuts
uhm, there is a bit of a mix-up with the yes-vs-no thing and negating. I'm apparently a bit tired, disregard the actual "no" and focus on the rest of the reply, explaining why what you want can't be done :) On Sat, Jan 13, 2018 at 1:35 AM, Axel Wagner wrote: > > > On Fri, Jan 12, 2018 at 11:23 P

Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread 'Axel Wagner' via golang-nuts
On Fri, Jan 12, 2018 at 11:23 PM, Peter Mogensen wrote: > > > On 2018-01-12 22:22, Axel Wagner wrote: > > Yes, you can *test* if the dynamic value has a specific type (and > > extract it if so). That is not the same as operating on the dynamic > > value (e.g. by dereferencing it) *without* knowin

[go-nuts] Re: Go on processor without SSE

2018-01-12 Thread krolaw
See: https://github.com/golang/go/issues/5266 Essentially, you need to recompile go with: export GO386=387 export GOOS=linux export GOARCH=386 Then you can successfully build using the same. (This allowed go to work on my Alix board.) Worked for Go 1.1beta, might still work now. On Saturday, 13

Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread Peter Mogensen
On 2018-01-12 22:22, Axel Wagner wrote: > Yes, you can *test* if the dynamic value has a specific type (and > extract it if so). That is not the same as operating on the dynamic > value (e.g. by dereferencing it) *without* knowing its type. I know I can test the type. But the issue was specifica

[go-nuts] Re: json: unmarshal map of structs

2018-01-12 Thread Manlio Perillo
Unfortunately that is not possible; it must be map[string]interface{} for my code to work correctly. I easily, hoping there are no bugs, managed to patch gopkg.in/yaml.v2 to work as I want, but the code of github.com/naoina/toml and encoding.json are more complex: https://pastebin.com/Arvz0WJB

[go-nuts] Re: json: unmarshal map of structs

2018-01-12 Thread SlothNinja
You are unmarshalling into a map[string]interface{}. Thus, the unmarshal function is basically not told what the value should be and thus unmarshals the JSON object into a map[string]interface. If you want the value to be a Postgres struct, then config must specify a Postgres value. See, e.g.

Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread 'Axel Wagner' via golang-nuts
On Fri, Jan 12, 2018 at 7:23 PM, Peter Mogensen wrote: > > On 2018-01-12 19:09, 'Axel Wagner' via golang-nuts wrote: > > One would think the result is rather well defined. > > > > It's not. The value in the interface doesn't have to be a pointer, so > > this is, in general, not defined at all.

[go-nuts] json: unmarshal map of structs

2018-01-12 Thread Manlio Perillo
Hi. Consider this example: https://play.golang.org/p/q7oEp40ZCIL Unmarshal replaces the existing map entry with key "Postgres". The documentation says: To unmarshal a JSON object into a map, Unmarshal first establishes a map to use. If the map is nil, Unmarshal allocates a new map.

Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread Peter Mogensen
On 2018-01-12 19:09, 'Axel Wagner' via golang-nuts wrote: > One would think the result is rather well defined. > > > It's not. The value in the interface doesn't have to be a pointer, so > this is, in general, not defined at all. No, but it's not like you cannot ask about interface{} in ge

Re: [go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread 'Axel Wagner' via golang-nuts
On Fri, Jan 12, 2018 at 6:32 PM, Peter Mogensen wrote: > Hi, > > I somehow ended up with an interface{} value being a **SomeStruct{} > > ... and I need to dereference it to an interface{} holding *SomeStruct{} > in a generic way (ie. without knowing about the type SomeStruct) > > I'm not at all s

[go-nuts] Dereferencing a pointer pointer interface value

2018-01-12 Thread Peter Mogensen
Hi, I somehow ended up with an interface{} value being a **SomeStruct{} ... and I need to dereference it to an interface{} holding *SomeStruct{} in a generic way (ie. without knowing about the type SomeStruct) I'm not at all sure this is good idea or the right way for the specific code, but out

[go-nuts] json array order preserved?

2018-01-12 Thread Tamás Gulácsi
Yes. Except when a coworker added a tricky MarshalJSON method to that type... -- 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

[go-nuts] json array order preserved?

2018-01-12 Thread BigJohn
Noob question... when I marshal an array into a JSON, is the order of that array preserved? -- 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.

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread digg
On Friday, January 12, 2018 at 9:00:34 AM UTC-5, di...@veryhaha.com wrote: > > > > On Friday, January 12, 2018 at 5:11:10 AM UTC-5, Axel Wagner wrote: >> >> Hm, this thread has actually opened up a question I don't have a good >> answer to. >> >> On Fri, Jan 12, 2018 at 9:47 AM, wrote: >> >>> t

Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread pradam
Hi Marvin, Awesome explanation. I have learnt alot things through your mail.once again you made my day. Thank you On 12-Jan-2018 9:31 PM, "Marvin Renich" wrote: > * pradam [180112 01:45]: > > I'm Newbie to golang, > > Welcome to Go! Many newbies often use "golang" rather than "Go" as the > l

Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread Marvin Renich
* pradam [180112 01:45]: > I'm Newbie to golang, Welcome to Go! Many newbies often use "golang" rather than "Go" as the language name, and most old-timers usually ignore this incorrect usage, but golang is an artifact of the web site's hostname, golang.org. Also, using golang in web searches fo

Re: [go-nuts] Re: Updating specific elements of a big json file.

2018-01-12 Thread Doğan Kurt
That seems to be the only solution. Thanks. On Friday, January 12, 2018 at 12:01:19 AM UTC+1, Burak Serdar wrote: > > > > On Jan 11, 2018 3:36 PM, "Doğan Kurt" > > wrote: > > I think i wasn't perfectly clear. When i say update i actually meant > insert, delete, update. > > I will delete big blo

Re: [go-nuts] Go on processor without SSE

2018-01-12 Thread Ian Lance Taylor
On Fri, Jan 12, 2018 at 2:03 AM, wrote: > > I'm searching how to compile golang to use it on an old 32bits cpu (AMD > Geode) without SSE. > > Any idea? Tell us exactly what you did and exactly how it failed. Ian -- You received this message because you are subscribed to the Google Groups "go

Re: [go-nuts] Non-Coherent Caches

2018-01-12 Thread Ian Lance Taylor
On Fri, Jan 12, 2018 at 2:03 AM, Chris Hopkins wrote: > > Does anyone know of an architecture that go runs on that has non-coherent > data caches? If so, is there a mechanism in the language/tool chain to > protect against the issues of this? > > Background: > I was watching a video on the go trac

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [180112 05:11]: > Hm, this thread has actually opened up a question I don't have a good > answer to. > > On Fri, Jan 12, 2018 at 9:47 AM, wrote: > > an untyped interger literal/constant is representable float64 type for > > sure. > > an untyped floating-point lite

Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread Shawn Milochik
On Fri, Jan 12, 2018 at 2:11 AM, pradam wrote: > Hi Shawn, > > Thank you, it was very helpful. I am not complaining about the language > just exploring the how golang works. > > Awesome! You're welcome. Sorry I misinterpreted your wording. -- You received this message because you are subscribed

[go-nuts] Re: How golang garbage collector works

2018-01-12 Thread digg
https://blog.golang.org/go15gc On Thursday, January 11, 2018 at 10:50:24 AM UTC-5, golangguy wrote: > > Hi > > I am new to golang, and had background in C/C++ , can you some one give me > information/explanation about how garbage collectors in golang works ? > > Thanks, > > -- You received thi

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread digg
On Friday, January 12, 2018 at 5:11:10 AM UTC-5, Axel Wagner wrote: > > Hm, this thread has actually opened up a question I don't have a good > answer to. > > On Fri, Jan 12, 2018 at 9:47 AM, > wrote: > >> then can I say >> an untyped rune literal/constant is representable int type for sure. >>

[go-nuts] Go on processor without SSE

2018-01-12 Thread nicolas . repentin
Hi all I'm searching how to compile golang to use it on an old 32bits cpu (AMD Geode) without SSE. Any idea? -- 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 go

[go-nuts] Getting oauth2 token without verifying certificate option

2018-01-12 Thread mdsalman
Hi, I am trying to get the oauth2 token from an internal token provider. I am using this to get the oauth2 token- package main import ( "golang.org/x/oauth2/clientcredentials" "golang.org/x/net/context" "fmt" "golang.org/x/oauth2" "crypto/tls" "net/http" ) func main(){ // this

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread 'Axel Wagner' via golang-nuts
Hm, this thread has actually opened up a question I don't have a good answer to. On Fri, Jan 12, 2018 at 9:47 AM, wrote: > then can I say > an untyped rune literal/constant is representable int type for sure. > Yes, rune is an alias for int32 and int is specified to have at least the precision

[go-nuts] Non-Coherent Caches

2018-01-12 Thread Chris Hopkins
Hi All, Does anyone know of an architecture that go runs on that has non-coherent data caches? If so, is there a mechanism in the language/tool chain to protect against the issues of this? Background: I was watching a video on the go trace tool (https://www.youtube.com/watch?v=ySy3sR1LFCQ) in t

[go-nuts] Re: Any plans to add ASN.1 PER support?

2018-01-12 Thread David Wahlstedt
ASN.1 is still alive and present in telecom applications. The PER encoding is missing in the go library, unfortunately... Den torsdag 11 januari 2018 kl. 20:04:50 UTC+1 skrev Pat Farrell: > > On Thursday, January 11, 2018 at 10:50:24 AM UTC-5, David Wahlstedt wrote: >> >> I wonder if there are an

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread digg
then can I say an untyped rune literal/constant is representable int type for sure. an untyped interger literal/constant is representable float64 type for sure. an untyped floating-point literal/constant is representable complex128 type for sure. On Friday, January 12, 2018 at 2:42:20 AM UTC-5, A

Re: [go-nuts] Re: Is my understanding on numeric literals right?

2018-01-12 Thread digg
On Friday, January 12, 2018 at 2:42:20 AM UTC-5, Axel Wagner wrote: > > What do you mean by "potential type"? There is no such concept. > > The spec is pretty clear, on the > subject, IMO. There is also this blog post >