Re: [go-nuts] flag: bug with shared values?

2020-09-18 Thread Manfred Touron
There are actually multiple cases of reusing the same XXXVar for the same variables: * https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/flag/example_test.go#L29-L30 -> to support shortcuts within the same command * projects with multiple flag.FlagSet (to manage va

Re: [go-nuts] Catch/handle cgo SIGSEGV

2020-09-18 Thread Tamás Gulácsi
Thank you very much! It's way more complicated than I'd to deal with, so I'll leave it as is: crash the program if the C side gots a SIGSEGV. Even the gRPC child seems more managable. Ian Lance Taylor a következőt írta (2020. szeptember 17., csütörtök, 22:11:18 UTC+2): > On Thu, Sep 17, 2020 at

Re: [go-nuts] What are the best practices for go build tools?

2020-09-18 Thread Paul Jolly
Hi Andi, > 1) I cannot do go install tools.go: go install takes main packages as arguments, so no, this will not work. The tools.go file (like the example you present) is simply a way of declaring a dependency on a main package through a file that will never be built (hence the +build tools const

[go-nuts] http.MaxByteReader & http: request body too large

2020-09-18 Thread Jérôme LAFORGE
Hello, I want to use http.MaxByteReader, but I want to know if it possible to return an package level error (like context.DeadlineExceeded) instead of create a new one (https://github.com/golang/go/blob/06f7e655d1764f5ad57bc14f82326c181c37901c/src/net/http/request.go#L1158). It seems more goi

[go-nuts] Gomobile xcframework generation

2020-09-18 Thread Valeriy Palyvoda
Is it possible to generate .xcframework file with gomobile? I built the .framework file with gomobile with the following command: gomobile bind -target ios -o ../frameworks/MyFramework.framework After that I tried to build .xcframework file with this command xcodebuild -create-xcframework -fr

[go-nuts] Cloud the current generic draft constraint a type parameter must be exactly some types

2020-09-18 Thread tapi...@gmail.com
instead of sharing the same underlying types with some types? -- 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. To view th

[go-nuts] Why does interface type carries pointer to basic types but not values itself?

2020-09-18 Thread Никифор Серяков
Lets imagine this code. ```go var i int func main() { i = 3 F(i) } var q interface{} //go:noinline func F(a interface{}) { q = a } ``` then run `go tool compile -S ~/a.go` Skipping all not related, in main function we'll see ``` 0x001d 00029 (/home/nik/a.go:6) MOVQ $3, "".i(SB)

Re: [go-nuts] Cloud the current generic draft constraint a type parameter must be exactly some types

2020-09-18 Thread Ian Lance Taylor
On Fri, Sep 18, 2020 at 10:07 AM tapi...@gmail.com wrote: > > instead of sharing the same underlying types with some types? In the current design draft, the answer is yes, but only for non-predeclared defined types. https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-pa

Re: [go-nuts] Why does interface type carries pointer to basic types but not values itself?

2020-09-18 Thread Ian Lance Taylor
On Fri, Sep 18, 2020 at 10:31 AM Никифор Серяков wrote: > > Lets imagine this code. > > ```go > var i int > > func main() { > i = 3 > > F(i) > } > > var q interface{} > > //go:noinline > func F(a interface{}) { > q = a > } > ``` > > then run `go tool compile -S ~/a.go` > > Skipping all

Re: [go-nuts] Cloud the current generic draft constraint a type parameter must be exactly some types

2020-09-18 Thread tapi...@gmail.com
If sum types are supported can they can be used as general parameter types, then it is possible to declare overloaded functions/methods demoed in the end of this article

Re: [go-nuts] flag: bug with shared values?

2020-09-18 Thread Ian Lance Taylor
On Fri, Sep 18, 2020 at 12:50 AM Manfred Touron wrote: > > 1. if I need to open an issue or not on the go repo, if the fix is not about > code, it can be about doc maybe? Documentation fixes are always welcome. You can open an issue or just send a change. > 2. if other gophers has ideas of wor

Re: [go-nuts] flag: bug with shared values?

2020-09-18 Thread Michael Jones
> 2. if other gophers has ideas of workaround? Use distinct values, but never access them directly. Write setter/getter functions that do the value sharing as you prefer and return the desired result. On Fri, Sep 18, 2020 at 11:30 AM Ian Lance Taylor wrote: > On Fri, Sep 18, 2020 at 12:50 AM