Re: [go-nuts] TestSetuidEtc fails during test execution in a container

2021-05-18 Thread 'Andrew G. Morgan' via golang-nuts
This should be fully resolved at HEAD now. On Friday, May 14, 2021 at 10:57:22 AM UTC-7 Andrew G. Morgan wrote: > > Indeed. I neglected to heed the comment I left expressly for this purpose. > :( > > Thanks! > > Andrew > > On Friday, May 14, 2021 at 10:25:18 AM UTC-7 ksri...@gmail.com wrote: >

Re: [go-nuts] How to cast a multi-value?

2021-05-18 Thread Amnon
My understanding was that a string had a pointer and a length, whereas a slice had a pointer and a length and a capacity. https://golang.org/src/reflect/value.go?s=59515:59567#L1973 On Tuesday, 18 May 2021 at 20:32:39 UTC+1 Brian Candler wrote: > Assigning a string value to another variable

Re: [go-nuts] How to cast a multi-value?

2021-05-18 Thread Brian Candler
Assigning a string value to another variable doesn't double the memory usage. A value of type string consists of a pointer, a length, and a capacity, and only these are copied - so you get another copy of the pointer, pointing to the same data buffer. > -- You received this message because

Re: [go-nuts] How to cast a multi-value?

2021-05-18 Thread 'Marc Michael' via golang-nuts
'Keith Randall' via golang-nuts schrieb am Di., 18. Mai 2021, 18:25: > You can use a function call to do the cast: > > func byteErr2stringErr(b []byte, e error) (string, error) { > return string(b), e > } > content, err := byteErr2stringErr(os.ReadFile(path)) > > It's still using additional

Re: [go-nuts] How to cast a multi-value?

2021-05-18 Thread 'Keith Randall' via golang-nuts
You can use a function call to do the cast: func byteErr2stringErr(b []byte, e error) (string, error) { return string(b), e } content, err := byteErr2stringErr(os.ReadFile(path)) It's still using additional variables, but they are hidden inside the helper function. On Sunday, May 16, 2021

Re: [go-nuts] How can I check error types of gRPC calls?

2021-05-18 Thread 'Axel Wagner' via golang-nuts
*want, sorry, typo :) On Tue, May 18, 2021 at 4:44 PM Axel Wagner wrote: > You cant to use status.Code(err) > , which gives you > the gRPC status code. > > > On Tue, May 18, 2021 at 3:08 PM cpu...@gmail.com > wrote: > >> >> Thank you for

Re: [go-nuts] How can I check error types of gRPC calls?

2021-05-18 Thread 'Axel Wagner' via golang-nuts
You cant to use status.Code(err) , which gives you the gRPC status code. On Tue, May 18, 2021 at 3:08 PM cpu...@gmail.com wrote: > > Thank you for the pointer. After looking at the API, I'm still confused > how to use it. I can

[go-nuts] Re: Golang document scanning with TWAIN

2021-05-18 Thread 郑昕
hi,Can you give me an example? 在2016年5月13日星期五 UTC+8 下午4:53:09 写道: > Thank you a lot Egon :) > > > On Thursday, 12 May 2016 07:49:10 UTC+2, Egon wrote: >> >> On Wednesday, 11 May 2016 16:43:29 UTC+3, dtr...@gmail.com wrote: >>> >>> Dear Gophers I'm an absolute begginner in Go. I do not grasp the

Re: [go-nuts] How can I check error types of gRPC calls?

2021-05-18 Thread Brian Candler
It's an alias for this: https://pkg.go.dev/google.golang.org/grpc/internal/status#Status So it should have Code() and Detail() methods. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] gonum plot : font error

2021-05-18 Thread Fred
@Roland : I saw this change too, removing the error variable fix the problem :) Le mardi 18 mai 2021 à 12:44:40 UTC+2, rol...@gmail.com a écrit : > Hello, > > applying Carlas's solution I got a failure in line 20 since plot.New() > returns a pointer but no pointer, error pair. > > Only after

Re: [go-nuts] How can I check error types of gRPC calls?

2021-05-18 Thread cpu...@gmail.com
Thank you for the pointer. After looking at the API, I'm still confused how to use it. I can status.Convert(err) to get a status object but couldn't really figure how how to use that to extract the actual underlying base error? On Saturday, May 15, 2021 at 2:12:28 PM UTC+2 kortschak wrote: >

Re: [go-nuts] gonum plot : font error

2021-05-18 Thread Roland Müller
Hello, applying Carlas's solution I got a failure in line 20 since plot.New() returns a pointer but no pointer, error pair. Only after changing usage of New() I got the scatter-demo running. May be error message can be enhanced :-) scatter-demo]$ go build # scatter-demo ./main.go:20:9:

Re: [go-nuts] Re: Map to struct and vice versa

2021-05-18 Thread Nick Keets
Thanks everyone for your responses. structs is interesting, but archived, pre modules even. Using reflect directly also doesn't seem that bad and I do want error handling, so it looks like nothing beats JSON in terms of UI. On Mon, May 17, 2021 at 6:22 PM Howard C. Shaw III wrote: > The