Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread Jon Reiter
i think it's gentler to look at this in the context of c's "hello world" program. the first version was missing both #include and void. then it got #include. then it got void. i recall void issues with code from k v1 on my compiler in the mid 80s (i do not predate include statements). i recall

Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread Eli Bendersky
On Mon, Mar 29, 2021 at 4:52 PM Rich wrote: > I really WANT to use go modules on all my projects, but there are times I > just want to write a quick piece of code that I can 'go run'. Its usually > just 20 lines, just used to test something out like a rest call to an > internal server (can't do

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread JX Zhang
> The Go runtime and standard library has a public, exported API; this sort of use of go:linkname to reach into the internals of a standard package (in this case, calling an unexported function) is not supported. The limitation to access private functions in std package sounds reasonable. > You

Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread 'Axel Wagner' via golang-nuts
I understand many criticisms of modules, but I honestly don't really get this one. You can just do `go mod init foo` in an empty directory, if all you want is some throwaway Go code. It doesn't actually seem very complicated to me, I must say. On Tue, Mar 30, 2021 at 1:52 AM Rich wrote: > I

Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread Rich
I really WANT to use go modules on all my projects, but there are times I just want to write a quick piece of code that I can 'go run'. Its usually just 20 lines, just used to test something out like a rest call to an internal server (can't do that on go playground) and for me go modules just

Re: [go-nuts] How to wait for HTTP server to start?

2021-03-29 Thread roger peppe
I often call net.Listen directly before calling Serve in a goroutine. That way you can connect to the server's socket immediately even though the server might take a while to get around to serving the request. Look at how net/http/httptest does it. On Sat, 27 Mar 2021, 14:13 cpu...@gmail.com,

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread fgergo
On Mon, Mar 29, 2021, 17:46 Wojciech S. Czarnecki wrote: > Dnia 2021-03-29, o godz. 15:17:42 > "'Axel Wagner' via golang-nuts" napisał(a): > > > I still don't understand how you think we should provide this > explanation without solving SAT. > ... > > What is "builtconstraint_1" and how is it

Re: [go-nuts] How to wait for HTTP server to start?

2021-03-29 Thread Jesper Louis Andersen
On Sat, Mar 27, 2021 at 3:19 PM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The best way to do it is probably by making an HTTP request and see if it > succeeds. In production, it's always a good idea to have a health check > endpoint anyways. So some service manager

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread Wojciech S. Czarnecki
Dnia 2021-03-29, o godz. 15:17:42 "'Axel Wagner' via golang-nuts" napisał(a): > I still don't understand how you think we should provide this explanation > without solving SAT. ... > What is "builtconstraint_1" and how is it determined by the go tool? My > first impression was that it is

Re: [go-nuts] what is asm6 and span6 for?

2021-03-29 Thread Andy Balholm
It is likely a code for GOARCH=amd64. Back in the distant past, there were separate Go compilers for different CPU architectures. The one for amd64 was 6g, for 386 it was 8g, etc. It looks like the x86 directory is code that was originally written for amd64, and then generalized to cover 386

[go-nuts] what is asm6 and span6 for?

2021-03-29 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go this file named asm6, and there is a func named span6, what is 6 for here? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread fgergo
On 3/29/21, Axel Wagner wrote: > On Mon, Mar 29, 2021 at 2:57 PM wrote: ... > An "explanation" like I described in my 2nd email would be very >> helpful and that isn't more complex than P. (If it is, please provide >> a hint.) >> > > I still don't understand how you think we should provide this

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread 'Axel Wagner' via golang-nuts
On Mon, Mar 29, 2021 at 2:57 PM wrote: > Thanks, fully agree on everything. > > Please consider this workflow: > 1. find package on pkg.go.dev (currently there is no build constraint > specific information listed beside the result, cf. issue #39195) > 2. get package (go get, git clone, cp etc.)

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread fgergo
Thanks, fully agree on everything. Please consider this workflow: 1. find package on pkg.go.dev (currently there is no build constraint specific information listed beside the result, cf. issue #39195) 2. get package (go get, git clone, cp etc.) 3. "build constraints exclude all Go files in ..."

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread peterGo
On Monday, March 29, 2021 at 8:32:53 AM UTC-4 peterGo wrote: > You haven't said whether you followed the "safe" instructions for > github.com/ugorji/go/codec to avoid building code/helper_unsafe.go, which > uses go:linkname. > > s/code/helper_unsafe.go/codec/helper_unsafe.go/ Peter -- You

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread peterGo
You haven't said whether you followed the "safe" instructions for github.com/ugorji/go/codec to avoid building code/helper_unsafe.go, which uses go:linkname. Package Documentation for github.com/ugorji/go/codec https://github.com/ugorji/go/blob/master/codec/README.md This package will

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread 'Than McIntosh' via golang-nuts
Hi, *>Thanks for your attention, but I tried to write a demo with go:linkname.* *>In fact, it works well with gollvm...So maybe it is not the exact cause for the problem* The problem is not that gollvm fails to implement go:linkname-- the problem is the way that this package

[go-nuts] Re: How to stream across json-seq RFC-7464

2021-03-29 Thread Sean Liao
If you can guarantee your input is always pretty printed like that, you could use bufio with a custom splitfunc to match `\n{`, no need to double parse json On Sunday, March 28, 2021 at 11:35:20 PM UTC+2 greg.sa...@gmail.com wrote: > > I've tried this suggestion and although its certainly a

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread 'Axel Wagner' via golang-nuts
FWIW, you might be assuming that a build tag always has the form `// +build linux` or `// +build !cgo` - in which case it's indeed clear what the "correct" answer is and how to determine it. But you can't assume that build tags only take that form, you can express *any* boolean formula, using any

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread 'Axel Wagner' via golang-nuts
I might not understand what you are intending. My understanding is that you want, given a set of .go files, know "why" they are excluded. Which, to me, means finding a configuration of build tags that would allow at least one of them to be built. A file can be built with a set of tags, if the

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread fgergo
Thanks for thinking about the issue! I should have asked for something more explicit, probably something like this: ; go build listconstraintexclusions buildconstraint_1 excludes: file1.go file2.go file3.go buildconstraint_2 excludes: file4.go file5.go No go files left to build. ; Iiuc the

Re: [go-nuts] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread 'Axel Wagner' via golang-nuts
In general, answering that question is NP-complete. It's the boolean satisfiability problem . It would be possible to implement *some* solution and maybe stop after a timeout or something. But even then, the answer will not be unique

Re: [go-nuts] Re: error in testcode

2021-03-29 Thread Brian Candler
Sorry, but that is not a complete, self-contained piece of code that I can run. -- 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] explain functionality similar to "go mod why for" to help with message "build constraints exclude all Go files in ..." ?

2021-03-29 Thread fgergo
Is there some functionality to list each build constraint that is not satisfied when the result of go get is "build constraints exclude all Go files in ..."? go mod why is very helpful when module dependencies are to be explained. A similar functionality would be helpful and maybe a message to

Re: [go-nuts] Re: error in testcode

2021-03-29 Thread Dr. Lincy Jim
I did func TestProvisionhistory(t *testing.T) { type fields struct { StatusStatus Type BookingType Updated time.Time History []BookingHistory } type args struct { b *Booking } tests :=

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread JX Zhang
> go:linkname to refer directly to functions that are defined but not exported by the standard library. > This is not supported and is likely to break with any new release. It evidently breaks with GoLLVM. Thanks for your attention, but I tried to write a demo with go:linkname. In fact, it

[go-nuts] Re: error in testcode

2021-03-29 Thread Brian Candler
Can you make a complete, runnable example which demonstrates the problem, on play.golang.org, and post the link here? -- 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

[go-nuts] error in testcode

2021-03-29 Thread Dr. Lincy Jim
Hi all, I have included the following lines of code if b.ConsentProvided { var t string if bl.Status != StatusExpired && bl.Status != StatusCancelled { t = fmt.Sprintf("Consent to share information by %s", bl.RequestedBy) //lchangetest1 if