[go-nuts] Re: "go vet -shadow" and named return variable

2018-10-01 Thread T L
"go vet -shadow" checks short variable declarations only. On Monday, October 1, 2018 at 10:56:13 AM UTC-4, Pierre Durand wrote: > > My code: > package main > > func main() { > a := 1 > _ = func() { > a := 2 > _ = a > } > _ = func() (a int) { > a = 2 > return a > } > _ = a > } > > "go vet -shadow"

[go-nuts] Re: allowed imports for go appengine

2018-10-01 Thread Stanley Iriele
As mentioned elsewhere on this thread. Appengine flex allows you to use any golang package. Appengine standard is a different story. Appengine standard has come a long way, but generally speaking you can't use sockets, syscall, any package that imports syscall, and you can't make outbound http r

[go-nuts] What can i transport in a channel?

2018-10-01 Thread Tamás Gulácsi
What is a channel? A mutex and a variable. So you can transfer anything, as the transfer is only a synchronized variable access. But that's is, so transferring a synv.Mutex is allowed, safe but wrong: it is copied by value (as everything) and this breaks the working of the mutex. -- You receive

[go-nuts] What can i transport in a channel?

2018-10-01 Thread Patrik Iselind
Hi, I came up with a question i cannot answer. Hopefully you guys can clarify things for me. If i've made a HTTP request and i get the response. I don't touch the body or anything at this point. Would that response be safe to transport in a channel? Having the other end process the response.

Re: [go-nuts] go mod: how to develop in multiple repos?

2018-10-01 Thread Paul Jolly
See https://github.com/golang/go/issues/26640 On Mon, 1 Oct 2018, 23:10 Dan Kortschak, wrote: > Is there an issue for this; it continues to fill me with dread that > temporary edits to committed files are intended to be part of a > development workflow. > > On Fri, 2018-09-28 at 06:24 -0700, Tam

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread robert engels
Great, maybe I can find some time and contribute back… I think it would go a long way towards working with complex hierarchy systems easier. > On Oct 1, 2018, at 11:36 PM, Agniva De Sarker > wrote: > > > > On Tuesday, 2 October 2018 04:30:54 UTC+5:30, Robert Engels wrote: > >> On Oct 1, 201

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread Agniva De Sarker
On Tuesday, 2 October 2018 04:30:54 UTC+5:30, Robert Engels wrote: > > > On Oct 1, 2018, at 4:59 PM, Ian Lance Taylor > wrote: > > On Mon, Oct 1, 2018 at 1:53 PM, robert engels > wrote: > > > If you go to the TCPConn SetReadDeadline function, it states “implements > the Conn SetReadDeadline me

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread robert engels
I’v been thinking about what I said below, and I think it is a real problem. It might not affect a lot of people because it only comes into play with complex object hierarchies and multiple implementations - but this is exactly what networking layers/libraries are. Without “implements” the docu

[go-nuts] Re: modules: Using vendored transitive dependencies of primary dependency

2018-10-01 Thread Justin Israel
Since I never found an answer to this, and I am still stumped, I have cross-posted here . Justin On Thursday, September 6, 2018 at 9:34:36 AM UTC+12, Justin Israel wrote: > >

Re: [go-nuts] deadlock "runtime.(*sigctx).preparePanic"

2018-10-01 Thread Ian Lance Taylor
On Mon, Oct 1, 2018 at 4:52 PM, pba wrote: > > I'm running into a situation where my program deadlocks due to (apparently) > a call to runtime.(*sigctxt).preparePanic which never exits (stack below). > > The program uses cgo and passes callbacks to the C library, this particular > panic seems to b

Re: [go-nuts] allowed imports for go appengine

2018-10-01 Thread Ian Lance Taylor
On Mon, Oct 1, 2018 at 4:24 PM, Dan Kortschak wrote: > > I'd ask this at google-appengine-go, but there does not appear to be > any real traffic to that group; numerous threads have only the single > post that is the question being asked. > > The documentation for go appengine is woeful in terms o

[go-nuts] deadlock "runtime.(*sigctx).preparePanic"

2018-10-01 Thread pba
I'm running into a situation where my program deadlocks due to (apparently) a call to runtime.(*sigctxt).preparePanic which never exits (stack below). The program uses cgo and passes callbacks to the C library, this particular panic seems to be triggered when the go callback returns to the C co

[go-nuts] allowed imports for go appengine

2018-10-01 Thread Dan Kortschak
I'd ask this at google-appengine-go, but there does not appear to be any real traffic to that group; numerous threads have only the single post that is the question being asked. The documentation for go appengine is woeful in terms of what is allowed and what is not (previously I asked here and th

Re: [go-nuts] go mod: how to develop in multiple repos?

2018-10-01 Thread thepudds1460
> "Is there an issue for this; it continues to fill me with dread that temporary edits to committed files are intended to be part of a development workflow." Hi kortschak, There is some related discussion here, which also includes some pointers to some related issues: https://groups.goog

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread robert engels
> On Oct 1, 2018, at 4:59 PM, Ian Lance Taylor wrote: > > On Mon, Oct 1, 2018 at 1:53 PM, robert engels wrote: >> >> If you go to the TCPConn SetReadDeadline function, it states “implements the >> Conn SetReadDeadline method”, with no way of referencing the documentation >> for Conn.SetReadD

Re: [go-nuts] go mod: how to develop in multiple repos?

2018-10-01 Thread Dan Kortschak
Is there an issue for this; it continues to fill me with dread that temporary edits to committed files are intended to be part of a development workflow. On Fri, 2018-09-28 at 06:24 -0700, Tamás Gulácsi wrote: > Use the replace directive with relative path. > -- You received this message becaus

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread Dan Kortschak
Thanks, Ian. Yes, I think that is doable. Dan On Mon, 2018-10-01 at 12:01 -0700, Ian Lance Taylor wrote: > On Sun, Sep 30, 2018 at 6:41 PM, Dan Kortschak > wrote: > > > > > > I have been translating some C socket networking code (not my main > > area > > of expertise) and there is something

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread Ian Lance Taylor
On Mon, Oct 1, 2018 at 1:53 PM, robert engels wrote: > > If you go to the TCPConn SetReadDeadline function, it states “implements the > Conn SetReadDeadline method”, with no way of referencing the documentation > for Conn.SetReadDeadline, in fact, no way of even getting to the Conn > interface…

[go-nuts] Re: cgo & stack size

2018-10-01 Thread papostolescu2
Answering my own question: using -extflags and passing the appropriate clang options (-stack_size) ("go tool link" for all options). On Monday, October 1, 2018 at 3:24:11 PM UTC-4, papost...@gmail.com wrote: > > I'm using cgo to interop with a 3rd-party library which requires at least > 3MB o

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread robert engels
That brings up a problem I have with the way godoc is generated/provided. If you go to the TCPConn SetReadDeadline function, it states “implements the Conn SetReadDeadline method”, with no way of referencing the documentation for Conn.SetReadDeadline, in fact, no way of even getting to the Conn

Re: [go-nuts] Re: Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-01 Thread Eric S. Raymond
Michael Ellis : > I'm finding that a good work flow involves commenting out all the > functions in the output and fixing them up one at a time. Agreed. That's exactly how  I'm doing the reposurgeon translation. With the additional step that I'm trying to write unit tests for each function as I go.

Re: [go-nuts] cgo & stack size

2018-10-01 Thread papostolescu2
GOARCH="amd64" GOOS="darwin" - Paul On Monday, October 1, 2018 at 3:32:06 PM UTC-4, Ian Lance Taylor wrote: > > On Mon, Oct 1, 2018 at 12:21 PM, > > wrote: > > > > I'm using cgo to interop with a 3rd-party library which requires at > least > > 3MB of stack size - what is the proper way of

[go-nuts] Re: Desktop printing

2018-10-01 Thread jucie . andrade
So, I want a hard copy of that precious document. Easy. Using Ged Wed software I command the document to be printed. Oh, no! Not in my local printer. Stop! No, I mean use the printer at the administrative office, much better. How do I tell Ged Wed software to use that printer instead of mine? W

Re: [go-nuts] cgo & stack size

2018-10-01 Thread Ian Lance Taylor
On Mon, Oct 1, 2018 at 12:21 PM, wrote: > > I'm using cgo to interop with a 3rd-party library which requires at least > 3MB of stack size - what is the proper way of initializing code to support > that ? All my cgo calls are done from separate goroutines which use channels > for in/out. What sys

[go-nuts] cgo & stack size

2018-10-01 Thread papostolescu2
I'm using cgo to interop with a 3rd-party library which requires at least 3MB of stack size - what is the proper way of initializing code to support that ? All my cgo calls are done from separate goroutines which use channels for in/out. Thanks. -- You received this message because you are s

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread Ian Lance Taylor
On Sun, Sep 30, 2018 at 6:41 PM, Dan Kortschak wrote: > > I have been translating some C socket networking code (not my main area > of expertise) and there is something that I don't see a way to do with > net.TCPConn. > > The original code sets a revc timeout using > > ``` > setsockopt(fd, SOL_SOC

Re: [go-nuts] "go vet -shadow" and named return variable

2018-10-01 Thread Pierre Durand
ok, thank you ! Le lundi 1 octobre 2018 19:31:58 UTC+2, Ian Lance Taylor a écrit : > > On Mon, Oct 1, 2018 at 7:56 AM, Pierre Durand > wrote: > > > > My code: > > package main > > > > func main() { > > a := 1 > > _ = func() { > > a := 2 > > _ = a > > } > > _ = func() (a int) { > > a =

Re: [go-nuts] Re: Is it safe to run go build in parallel?

2018-10-01 Thread Mark Rushakoff
I saw that you wrote > The reason that I'm using shared GOPATH for this Jenkins step/job is that to now download the packages in `pkg/mod`. And I thought that meant you were using modules. Discussion in https://github.com/golang/go/issues/26677 says that the build cache is explicitly safe, but i

Re: [go-nuts] wrong ELF class error: How to compile 64 bit binary on Solaris 11 using gccgo

2018-10-01 Thread amandeep
Thanks. I found that on Solaris 11 the 64 bit libs are generated under /usr/gnu/lib/64 when gcc was configured with --prefix= /usr/gnu. Everything works on Solaris 11. However, I am facing problems on Solaris 10 as it seems there are no 64-bit libs generated there. I will ask another question i

[go-nuts] Re: Is it safe to run go build in parallel?

2018-10-01 Thread Yulrizka
Hi Mark, what I find interesting is that I haven't enable go module yet. As you can see in the errors that I'm still using a vendor directory On Monday, October 1, 2018 at 6:27:57 PM UTC+2, Mark Rushakoff wrote: > > https://github.com/golang/go/issues/26794 is "can't run go builds > concurrent

Re: [go-nuts] "go vet -shadow" and named return variable

2018-10-01 Thread Ian Lance Taylor
On Mon, Oct 1, 2018 at 7:56 AM, Pierre Durand wrote: > > My code: > package main > > func main() { > a := 1 > _ = func() { > a := 2 > _ = a > } > _ = func() (a int) { > a = 2 > return a > } > _ = a > } > > "go vet -shadow" reports a problem with the first function/closure, but > nothing for the se

[go-nuts] Re: Is it safe to run go build in parallel?

2018-10-01 Thread mark
https://github.com/golang/go/issues/26794 is "can't run go builds concurrently if they download modules". In that issue, Russ says: > There is a plan to make downloading of modules by parallel go commands safe but we haven't done that yet. On Monday, October 1, 2018 at 8:43:00 AM UTC-7, Yulrizk

[go-nuts] Re: Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-01 Thread Michael Ellis
Thanks, Eric. v1.1 runs to completion on my utils.py test case. I'm finding that a good work flow involves commenting out all the functions in the output and fixing them up one at a time. Here's what pytogo did for me on my base36encode function and what I had to do manually: *python:* def ba

Re: [go-nuts] Re: Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-01 Thread Eric S. Raymond
Ben Hoyt : > How well does pytogo work on the pytogo source? :-) I tried it only once. The crackling of purple lighting around my monitor and the distant sound of voices chanting in an unknown tongue should have warned me to desist sooner, but it was all fun and games until our cat nearly fell thr

[go-nuts] Is it safe to run go build in parallel?

2018-10-01 Thread Yulrizka
Hi, Recently, I played around with our Jenkins pipeline. In the new set-up, I build multiple packages in parallel. This step executes "go build" for each of the services that we have at the same time. One thing I also change is that for each service, it uses the same GOPATH. Sometimes, I see fa

[go-nuts] Re: Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-01 Thread Ben Hoyt
How well does pytogo work on the pytogo source? :-) On Monday, October 1, 2018 at 6:00:17 AM UTC-4, Eric Raymond wrote: > > I've fixed the bug in handling of multiline strings. > > 1.1 also translate commion for-loop patterns to Go, including traversing > lists and dictionaries and doing enumerat

[go-nuts] "go vet -shadow" and named return variable

2018-10-01 Thread Pierre Durand
My code: package main func main() { a := 1 _ = func() { a := 2 _ = a } _ = func() (a int) { a = 2 return a } _ = a } "go vet -shadow" reports a problem with the first function/closure, but nothing for the second one. Why ? If I understand correctly, it doesn't consider variable declaration in a

[go-nuts] Re: Constraints for generics

2018-10-01 Thread komuW
On Sunday, 30 September 2018 13:33:23 UTC+3, Christian Surlykke wrote: > > Hi > > I made a proposal for generics with constraints about ½ a year ago, which > I posted to the (very long) thread on issue 15292. I've now made a version > 2

[go-nuts] Re: Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-01 Thread Eric Raymond
I've fixed the bug in handling of multiline strings. 1.1 also translate commion for-loop patterns to Go, including traversing lists and dictionaries and doing enumerates. On Sunday, September 30, 2018 at 6:02:21 PM UTC-4, Michael Ellis wrote: > > I'd love to make use of pytogo my own project. I

Re: [go-nuts] cgo use question

2018-10-01 Thread Gulácsi Tamás
Got it, thanks! Scott Cotton ezt írta (időpont: 2018. okt. 1., H, 11:11): > > Hi, > > My use case is very very particular and unlikely to be related to most cgo > use cases. > > The use case requires that there is no C calling of Go. the requirements > arise from a special set of circumstances

Re: [go-nuts] Unsupported File Format error while building for linux-amd64 on mac os

2018-10-01 Thread Ankit Gupta
Tamas, I installed docker on mac and cross compiled using xgo like you suggested. Worked perfectly. Thanks a lot! On Saturday, September 29, 2018 at 1:58:20 AM UTC+5:30, Tamás Gulácsi wrote: > > 2018. szeptember 28., péntek 15:59:14 UTC+2 időpontban Ankit Gupta a > következőt írta: >> >> Thanks

Re: [go-nuts] cgo use question

2018-10-01 Thread Scott Cotton
Hi, My use case is very very particular and unlikely to be related to most cgo use cases. The use case requires that there is no C calling of Go. the requirements arise from a special set of circumstances, including 1. if C calls Go, then it is on a thread created in C 2. the thread above and e

Re: [go-nuts] cgo use question

2018-10-01 Thread Tamás Gulácsi
Sorry, I don't understand this. Why can't you `//export` a Go function in package A - a function which calls your cgo function? And why can't you `//export` a Go function in package B - a function which calls the exported Go function in package A ??? -- You received this message because you a

Re: [go-nuts] cgo use question

2018-10-01 Thread Scott Cotton
Yes, but as noted, I can't do Go wrappers in this case. On Mon, 1 Oct 2018 at 05:01, Tamás Gulácsi wrote: > You could export the C function in a Go wrapper in package A, and use that. > Maybe another exported Go wrapper is needed in package B, I don't know. > > -- > You received this message b