Re: [go-nuts] tests, init() and flags

2021-04-24 Thread Amit Saha
On Sun, Apr 25, 2021 at 7:10 AM Shivendra Singh wrote: > > Yes @Jan Mercl absolutely correct!! > > Able to figure out a solution. > Basically the go mod i am using as part of the code is doing something like > this : > func init() { > //reads vars > flag.Parse() > } > > The problem arises when d

Re: [go-nuts] tests, init() and flags

2021-04-24 Thread Shivendra Singh
Yes @Jan Mercl absolutely correct!! Able to figure out a solution. Basically the go mod i am using as part of the code is doing something like this : func init() { //reads vars flag.Parse() } The problem arises when doing flag.Parse() as part of the init. https://github.com/golang/go/issues/318

Re: [go-nuts] tests, init() and flags

2021-04-24 Thread Jan Mercl
On Sat, Apr 24, 2021 at 10:37 PM Shivendra Singh wrote: > ..., now in the init() method it parses flag to read variables such as env > and app name that is required to load the appropriate config. IINM, calling flag.Parse anywhere else than in main() or TestMain() is not really compatible with

[go-nuts] tests, init() and flags

2021-04-24 Thread Shivendra Singh
Hi!! I have a use case as following : 1. There is a go program that is used for managing run time configs of our applications. (basically all our run time configs are in GitHub and this code reads and provides to app based on certain run time args as mentioned below) This program is added as go

[go-nuts] Re: Setting the Don't Fragment (DF) bit on OSX

2021-04-24 Thread Stefan Beke
I'm curious, why do you need to set DF bit? I'm asking, because as a network engineer I'm often experiencing broken apps with this setting. It usually ends up network pointing to app and vice versa. New tunnel along the path, either GRE or IPSec is lowering MTU, new technologies like Cisco SD-WA

[go-nuts] Re: what is a &^= b means?

2021-04-24 Thread Brian Candler
More or less equivalent to: a = a & (^b) where & is bitwise AND operator, and ^ is bitwise NOT operator. Upshot: any bit which is 1 in 'b' causes the corresponding bit in 'a' to be set to 0. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] what is a &^= b means?

2021-04-24 Thread Wojciech S. Czarnecki
Dnia 2021-04-24, o godz. 05:42:01 xie cui napisaƂ(a): > what is this op (&^=) means? This is common idiom for "bit clear" in Go Chinese: https://gfw.go101.org/article/operators.html English: https://go101.org/article/operators.html https://golang.org/ref/spec#assign_op https://yourbasic.org/g

[go-nuts] Re: A question about go bug template

2021-04-24 Thread Manlio Perillo
GOROOT is in fact set separately for ~/sdk/go1.12.17 (by the wrapper in GOBIN/go1.12.17), but in the end the go command used should be the same. Thanks. Il giorno sabato 24 aprile 2021 alle 13:22:03 UTC+2 seank...@gmail.com ha scritto: > 1 for consistency in the report template (helps triagers

Re: [go-nuts] what is a &^= b means?

2021-04-24 Thread Jan Mercl
On Sat, Apr 24, 2021 at 2:42 PM xie cui wrote: > func f(a, b int) int { > a &^= b > return a > } > what is this op (&^=) means? There is a wonderful source of answers to such questions here: https://golang.org/ref/spec -- You received this message because you are subscribed to the Goog

[go-nuts] Re: what is a &^= b means?

2021-04-24 Thread xie cui
it means OANDNOT!!! On Saturday, April 24, 2021 at 8:42:01 PM UTC+8 xie cui wrote: > func f(a, b int) int { > a &^= b > return a > } > what is this op (&^=) means? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from t

[go-nuts] what is a &^= b means?

2021-04-24 Thread xie cui
func f(a, b int) int { a &^= b return a } what is this op (&^=) means? -- 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...@googlegroup

[go-nuts] Re: A question about go bug template

2021-04-24 Thread Sean Liao
1 for consistency in the report template (helps triagers) 2 GOROOT may actually be set separately On Saturday, April 24, 2021 at 9:34:17 AM UTC+2 manlio@gmail.com wrote: > In the go bug template, go version is printed twice, the first time in > the "go version" section and the second time i

Re: [go-nuts] Purpose of TimeoutHandler

2021-04-24 Thread Brian Candler
That works too. Err() is guaranteed to return non-nil, either if the context was explicitly cancelled or its deadline was exceeded. -- 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

Re: [go-nuts] Purpose of TimeoutHandler

2021-04-24 Thread Amit Saha
> On 19 Apr 2021, at 10:07 pm, Amit Saha wrote: > > Thank you, I was suspecting that this might be the way to do it. This is another approach I thought would also work without using channels or where you are just running a sequence of steps in a handler: func handleUserAPI(w http.ResponseWri

Re: [go-nuts] Your opinion on go-convey please

2021-04-24 Thread Amarjeet Anand
Hi Kurtis Thanks for your response. Yes. Am asking regarding https://github.com/smartystreets/goconvey and testing.t.Run() On Sat, 24 Apr, 2021, 8:19 am Kurtis Rader, wrote: > On Fri, Apr 23, 2021 at 7:34 PM Amarjeet Anand < > amarjeetanandsi...@gmail.com> wrote: > >> Do you see go-convey addi

[go-nuts] A question about go bug template

2021-04-24 Thread Manlio Perillo
In the go bug template, go version is printed twice, the first time in the "go version" section and the second time in the "details" section as GOROOT/bin/go version. After https://golang.org/cl/288693 , these two entries should show the same version. In order for them to differ, one should do