Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-21 Thread Ian Lance Taylor
On Mon, Jan 21, 2019 at 4:26 PM 'simon place' via golang-nuts wrote: > > i thought i remembered, a few releases back, that the go compiler started > doing wider ranging analysis that allowed it to optimise and do some low > level dead code elimination? > > if so, wouldn't that mean that any

[go-nuts] Opinions on monorepo multi-module build strategy

2019-01-21 Thread Andrei Avram
Hello, Could you show the layout of your repository? -- 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. For more options,

Re: [go-nuts] This Makes No Sense

2019-01-21 Thread Justin Israel
On Tue, Jan 22, 2019 at 11:40 AM John wrote: > Dear Gophers, > > I have recently made a project of Connect Five. When the imput is wrong it > will have a goroutine problem that says something about out of index, as my > game win function depends on if the x = b and x+1 = b and so on. But if the

Re: [go-nuts] How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-21 Thread Sam Whited
On Tue, Jan 22, 2019, at 03:26, Antonio Romeo Riga wrote: > I would like to do something like that > fmt.Printf("%-15v %5.2f %5.2f" , coin, piggyBank) > > %-15v and %5.2f should change the variable 'coin'. If you want the first two verbs to both affect "coin" in your example, use bracket

[go-nuts] How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-21 Thread Antonio Romeo Riga
Hello Gophers. I dont know how concatenate with fmt.Printf plus of 1 type of formatting. Example : I would like to do something like that fmt.Printf("%-15v %5.2f %5.2f" , coin, piggyBank) %-15v and %5.2f should change the variable 'coin'. I tried so much, in many way, but nothing. Its possible?

Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-21 Thread 'simon place' via golang-nuts
i thought i remembered, a few releases back, that the go compiler started doing wider ranging analysis that allowed it to optimise and do some low level dead code elimination? if so, wouldn't that mean that any extra blank-return 'clones' would potentially be able to be compiled with more code

Re: [go-nuts] Re: Why is this an assignment count mismatch?

2019-01-21 Thread Ian Lance Taylor
On Sun, Jan 20, 2019 at 7:14 AM wrote: > > It can be verified by use of tuples > x, (y, z) := A[id1], B[id2] > > But the above doesn't work. Why ? Well, because that's not how the language works. The language doesn't support tuples. It supports some specific cases of assignment to multiple

Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-21 Thread Ian Lance Taylor
On Sun, Jan 20, 2019 at 2:44 PM 'simon place' via golang-nuts wrote: > > wouldn't the compiler be able to use the fact that a return value is known > not to be being used in a particular call, somewhere one or more of the > returned values are assigned to a blank, to be able to generate faster

[go-nuts] This Makes No Sense

2019-01-21 Thread John
Dear Gophers, I have recently made a project of Connect Five. When the imput is wrong it will have a goroutine problem that says something about out of index, as my game win function depends on if the x = b and x+1 = b and so on. But if the imput is not 1,2 1,3 and so on, or it is over 15, 15

Re: [go-nuts] identifier ... may conflict with identifiers generated by cgo

2019-01-21 Thread Ian Lance Taylor
On Mon, Jan 21, 2019 at 3:56 AM Tamás Gulácsi wrote: > > Instead of > > ns := make([]*_Ctype_char, 2*len(namespaces)+1) > > Use > > > ns := make([]*C.char, 2*len(namespaces)+1) Let me add that using C.char has always been the documented and supported way to use cgo, and I have no

Re: [go-nuts] Re: What does "nil implay?

2019-01-21 Thread Ian Lance Taylor
On Mon, Jan 21, 2019 at 5:19 AM 伊藤和也 wrote: > > So what do you think "nil" represents instead? > "nil" is just a special value? for slices, maps. There is no one answer to that question. As you know, `nil` is the value of an uninitialized variable of interface, slice, pointer, map,

Re: [go-nuts] Re: GO lang not able to decrypt the xor-base64 text

2019-01-21 Thread Michael Jones
Another way to think about it... https://play.golang.org/p/XtfFgwYw3f8 On Mon, Jan 21, 2019 at 10:26 AM wrote: > Like Christian said, your main problem is how Javascript and how Go > iterate. > > In your Javascript example, you use: > > for(var i=0;i > so you iterate in a +1 increment

Re: [go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread Justin Israel
On Tue, Jan 22, 2019, 8:27 AM snmed wrote: > Hi thanks, > > Ah yes, it seems that i forgot that with the static library. Now i've the > static library under ./libs folder and i use this command: > go build -ldflags '-L./libs -w -extldflags "-static"' -a > > but now i get this message: > flag

Re: [go-nuts] Re: What does "nil implay?

2019-01-21 Thread Inanc Gumus
Actually, that's not the whole story. For example, take a look at this example: https://play.golang.org/p/Wxq8vrBoqDr Inanc Gumus learngoprogramming.com On Mon, Jan 21, 2019 at 8:05 PM diego patricio wrote: > From stackoverflow, i think that is a proper explanation > > [image: image.png] > >

Re: [go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread snmed
Hi thanks, Ah yes, it seems that i forgot that with the static library. Now i've the static library under ./libs folder and i use this command: go build -ldflags '-L./libs -w -extldflags "-static"' -a but now i get this message: flag provided but not defined: -L./libs usage: link [options]

[go-nuts] Re: GO lang not able to decrypt the xor-base64 text

2019-01-21 Thread silviucapota
Like Christian said, your main problem is how Javascript and how Go iterate. In your Javascript example, you use: for(var i=0;ihttps://play.golang.org/p/23nMX2dFhJF On Sunday, 20 January 2019 10:14:05 UTC-5, Soorya Prakash wrote: > > > I am using the below code to encrypt and decrypt the

Re: [go-nuts] Obtaining compiled module information at run time

2019-01-21 Thread Maxim Khitrov
Ha! Yes, that looks exactly like what I needed. Thanks for the tip! -Max On Mon, Jan 21, 2019 at 11:44 AM roger peppe wrote: > > Perhaps you were looking for this, which will be available in the upcoming > go1.12 release? > > https://tip.golang.org/pkg/runtime/debug/#ReadBuildInfo > > On Mon,

Re: [go-nuts] Re: What does "nil implay?

2019-01-21 Thread diego patricio
>From stackoverflow, i think that is a proper explanation [image: image.png] https://stackoverflow.com/questions/35983118/what-does-nil-mean-in-golang Regards El lun., 21 ene. 2019 a las 14:19, 伊藤和也 () escribió: > So what do you think "nil" represents instead? > "nil" is just a special value?

Re: [go-nuts] Obtaining compiled module information at run time

2019-01-21 Thread roger peppe
Perhaps you were looking for this, which will be available in the upcoming go1.12 release? https://tip.golang.org/pkg/runtime/debug/#ReadBuildInfo On Mon, 21 Jan 2019 at 02:50, Maxim Khitrov wrote: > I was working on a tool that needed to know the file system paths and > version information of

Re: [go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread Kurtis Rader
You say you "verified that all necessary libs are under /lib64." Do you actually have static versions of those libraries or just dynamic versions? For example, on macOS I only have dynamic (ending in .dylib) versions so it isn't possible to statically link a binary that requires those libraries.

[go-nuts] Statically compile and link a go program with C dependencies

2019-01-21 Thread snmed
Hi all I try to compile and statically link the following example: https://github.com/rthornton128/goncurses/tree/master/examples/curs_menu I use this command: go build -ldflags '-w -extldflags "-static"' -a Unfortunately i get only this: /usr/lib/go/pkg/tool/linux_amd64/link: running gcc

Re: [go-nuts] Re: What does "nil implay?

2019-01-21 Thread Inanc Gumus
Nil = Uninitialized (slices, maps, channels, funcs etc) Nil = Doesn't point to anything (pointers) And so on. -- Inanc Gumus https://learngoprogramming.com On Mon, Jan 21, 2019 at 4:19 PM 伊藤和也 wrote: > So what do you think "nil" represents instead? > "nil" is just a special value? for

[go-nuts] Re: What does "nil implay?

2019-01-21 Thread 伊藤和也
So what do you think "nil" represents instead? "nil" is just a special value? for slices, maps. 2019年1月21日月曜日 8時00分24秒 UTC+9 伊藤和也: > > I know "nil" is zero values for slices, maps, interfaces, etc but I don't > know what "nil" implays. Does nil implay the absence of value or a variable >

[go-nuts] Re: What does "nil implay?

2019-01-21 Thread 伊藤和也
2019年1月21日月曜日 21時05分51秒 UTC+9 Inanc Gumus: > > Nil value doesn't mean the absence of a value, because nil itself is a > value. For example, a slice variable can hold the nil value, in that case, > it means that the slice hasn't been initialized yet (that it has no backing > array). > > On

[go-nuts] Re: What does "nil implay?

2019-01-21 Thread Inanc Gumus
Nil value doesn't mean the absence of a value, because nil itself is a value. For example, a slice variable can hold the nil value, in that case, it means that the slice hasn't been initialized yet (that it has no backing array). On Monday, January 21, 2019 at 2:00:24 AM UTC+3, 伊藤和也 wrote: > >

[go-nuts] identifier ... may conflict with identifiers generated by cgo

2019-01-21 Thread Tamás Gulácsi
Instead of ns := make([]*_Ctype_char, 2*len(namespaces)+1) Use ns := make([]*C.char, 2*len(namespaces)+1) -- 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

[go-nuts] identifier ... may conflict with identifiers generated by cgo

2019-01-21 Thread Peter Kleiweg
Installing packages with go1.12beta2 I get these messages: ... github.com/rug-compling/alpinocorpus-go/alpinocorpus/reader.go:39:15: identifier "_Ctype_alpinocorpus_iter" may conflict with identifiers generated by cgo ...