[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-19 Thread Amnon
go build ./... does build you program. I think most people would be a bit surprised if it did something other than build. If you don't want to build your program, but just vet that they are syntactically correct then maybe try something like go vet ./... On Monday, 19 April 2021 at 16:36:14

[go-nuts] Re: Is there a bug in the command "go list -deps -json ./..."?

2021-04-19 Thread tapi...@gmail.com
I mean, should package "github.com/Azure/go-autorest/autorest/azure" be in module "github.com/Azure/go-autorest/autorest/adal"? And, should package "cloud.google.com/go/compute/metadata"" be in module " cloud.google.com/go/bigquery"? On Monday, April 19, 2021 at 12:05:38 PM UTC-4 Brian Candler

Re: [go-nuts] Re: help with the Google Pub/Sub Go client API

2021-04-19 Thread 'Dan Kortschak' via golang-nuts
Comments in-line. On Mon, 2021-04-19 at 15:08 -0700, 'hong...@google.com' via golang-nuts wrote: > Ah, glad your issue was resolved. I did want to point out one thing: > > > 2. The topic was obtained in the subscriber using new topic > creation > > `client.CreateTopic(ctx, topic)` rather than

Re: [go-nuts] Re: help with the Google Pub/Sub Go client API

2021-04-19 Thread 'hong...@google.com' via golang-nuts
Ah, glad your issue was resolved. I did want to point out one thing: > 2. The topic was obtained in the subscriber using new topic creation > `client.CreateTopic(ctx, topic)` rather than getting a topic reference > `client.Topic(topic)` which I see now is incorrect (thought which is > poorly

[go-nuts] Re: Autocert failure with HTTP handler

2021-04-19 Thread cpu...@gmail.com
That makes perfect sense as the simple reproducer shows: https://play.golang.org/p/vSEBtdV2CzR Only in this case I didn't see it as there were more go routines alive. Much appreciated, thank you! On Monday, April 19, 2021 at 11:29:31 PM UTC+2 Brian Candler wrote: > As far as I understand it:

Re: [go-nuts] Re: help with the Google Pub/Sub Go client API

2021-04-19 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2021-04-19 at 10:37 -0700, 'hong...@google.com' via golang-nuts wrote: > Is it possible for you to paste your yaml config file? At first > glance, nothing seems to be out of the ordinary, but I'd like to try > with the same configuration that you have to see if I missed > anything.

[go-nuts] Re: Autocert failure with HTTP handler

2021-04-19 Thread Brian Candler
As far as I understand it: "go foo(bar, baz)" evaluates all the arguments first, *then* starts a goroutine with function foo(val1, val2) Since http.ListenAndServe() never returns [unless it fails to start], it never gets as far as starting a goroutine for log.Fatal, and therefore cannot

[go-nuts] Autocert failure with HTTP handler

2021-04-19 Thread cpu...@gmail.com
Hello, I have a very stupid problem with autocert. The below code works: log.Println("sslHosts:", sslHosts) log.Println("sslCertDir:", sslCertDir) certManager := autocert.Manager{ Prompt: autocert.AcceptTOS, HostPolicy: autocert.HostWhitelist(strings.Split(sslHosts, " ")...), Cache:

Re: [go-nuts] Trying to port Go to HPE NonStop x86 - Need some guidance

2021-04-19 Thread Ian Lance Taylor
On Fri, Apr 16, 2021 at 2:28 AM Shiva wrote: > > Since I haven't generated the various ztypes_nsx_GOARCH.go files, I think I > need to use +build nsx and not ignore the build for types_nsx.go. > > I found a way to run bootstrap.bat on windows but I was told that I had to > run make.bat instead,

[go-nuts] Re: help with the Google Pub/Sub Go client API

2021-04-19 Thread 'hong...@google.com' via golang-nuts
Could you also post the logs when you run the non-working version? On Thursday, April 15, 2021 at 3:00:55 AM UTC-7 kortschak wrote: > I am trying to set up a toy to understand Google's Pub/Sub service Go > client API. I have had no trouble with publishing and have a local > emulator for the

[go-nuts] Re: help with the Google Pub/Sub Go client API

2021-04-19 Thread 'hong...@google.com' via golang-nuts
Is it possible for you to paste your yaml config file? At first glance, nothing seems to be out of the ordinary, but I'd like to try with the same configuration that you have to see if I missed anything. On Thursday, April 15, 2021 at 3:00:55 AM UTC-7 kortschak wrote: > I am trying to set up a

[go-nuts] Re: Is there a bug in the command "go list -deps -json ./..."?

2021-04-19 Thread Brian Candler
Can you explain exactly which values you think are wrong, and what values they should have? I can't see any problem with those. Examples I checked: github.com/Azure/go-autorest/autorest/azure ^module (there is a go.mod here

[go-nuts] Is there a bug in the command "go list -deps -json ./..."?

2021-04-19 Thread tapi...@gmail.com
I checked out the kubernetes project at tag v1.20.4. Then run "go list -deps -json ./... > json,txt" in the project root. In the produced json.txt file, I notice that the module path for two packages look not right. The path of a package should be prefixed with its module path. But the two don't.

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-19 Thread tapi...@gmail.com
Thanks for the information. Personally, I think the behavior is hard to predict. The binary should be only produced when a single path is specified. On Monday, April 19, 2021 at 10:59:33 AM UTC-4 Brian Candler wrote: > In short, yes this is as intended, although somewhat obscure. The >

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-19 Thread Brian Candler
In short, yes this is as intended, although somewhat obscure. The documentation is here : *"When compiling a single main package, build writes the resulting executable to an output file named after the first source file ('go

[go-nuts] Re: go build ./... will produce a binary of one and only one main package is found

2021-04-19 Thread tapi...@gmail.com
Sorry, "of" should "if" in title. On Monday, April 19, 2021 at 9:40:00 AM UTC-4 tapi...@gmail.com wrote: > I often use "go build ./..." command to check if there are compilation > errors. Before ./... included 2+ main packages but now only one. Then the > behavior changes, I accidentally

[go-nuts] go build ./... will produce a binary of one and only one main package is found

2021-04-19 Thread tapi...@gmail.com
I often use "go build ./..." command to check if there are compilation errors. Before ./... included 2+ main packages but now only one. Then the behavior changes, I accidentally commit and push a 10M binary to the remote repository. Is this a intended design? -- You received this message

Re: [go-nuts] Re: Purpose of TimeoutHandler

2021-04-19 Thread Amit Saha
Thank you, I was suspecting that this might be the way to do it. On Mon, 19 Apr 2021, 6:02 pm Brian Candler, wrote: > Your inner request handler needs to use the request context to cancel its > work. > > package main > > import ( > "log" > "net/http" > "time" > ) > > type foo struct{} > >

Re: [go-nuts] Is unsafe.Pointer(reflect.Value.UnsafeAddr()) safe?

2021-04-19 Thread Name No
Thanks. I did misunderstand the 'exception'. 在2021年4月18日星期日 UTC+8 下午5:19:22 写道: > Not "raise an exception", "make an exception". Go doesn't have exceptions, > so the word "exception" here means "not do something you'd otherwise do" - > namely "complain about the conversion of a uintptr to an

[go-nuts] Re: encoding/xml expose line

2021-04-19 Thread Patrick
Thank you Peter, I have opened an issue (https://github.com/golang/go/issues/45628). Patrick -- 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-nuts] Re: Purpose of TimeoutHandler

2021-04-19 Thread Brian Candler
Your inner request handler needs to use the request context to cancel its work. package main import ( "log" "net/http" "time" ) type foo struct{} func (f foo) ServeHTTP(w http.ResponseWriter, r *http.Request) { log.Print("New request") for i := 0; i < 10; i++ { select { case