[go-nuts] Lenient Parsing of Date Time Strings

2020-02-03 Thread Joseph Lorenzini
Hi all, In the java standard library, there is a lenient mode, where heuristics are used to take a potentially invalid string and convert it to a valid date time. https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html#setLenient-boolean- For example, a date like this 1983-02-00T0

[go-nuts] Re: Experience report on a large Python-to-Go translation

2020-02-03 Thread Jon Conradt
While names arguments like foo(x= 1.0, y = 23) may look like syntactic sugar, I think you are right that they improve readability, especially of long argument lists. The counter argument I suppose if that you could pass structs around, but that gets ugly fast. Thinking about how this would be

Re: [go-nuts] [Proposal] Change how gofmt formats struct fields

2020-02-03 Thread David Riley
On Feb 1, 2020, at 9:00 AM, Manlio Perillo wrote: > > On Saturday, February 1, 2020 at 12:45:23 AM UTC+1, David Riley wrote: >> Please don't do this. Or make it an opt-in. This is not a good change to >> force on users by default. >> > > You are right, thanks. > I guess the only possible so

Re: [go-nuts] Question about 'import' statement

2020-02-03 Thread Ian Lance Taylor
On Mon, Feb 3, 2020 at 11:40 AM joe mcguckin wrote: > > Do all the files listed in the 'import' statement get pulled in and compiled, > or merely scanned to resolve function references etc. > > As someone who grew up on 'C', it seems a bit weird to not have an 'include' > mechanism and its heade

Re: [go-nuts] Question about 'import' statement

2020-02-03 Thread Brian Candler
Also, I believe "go fmt" sorts the imports. -- 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 this discussion on t

Re: [go-nuts] Question about 'import' statement

2020-02-03 Thread Marcin Romaszewicz
All the files get downloaded to your $GOPATH/src or $GOPATH/pkg, depending on whether modules are enabled. Everything gets compiled together into the same static executable, so yes, the files get compiled. The order of imports should not matter in well written code, but you can always create scen

[go-nuts] Question about 'import' statement

2020-02-03 Thread joe mcguckin
Do all the files listed in the 'import' statement get pulled in and compiled, or merely scanned to resolve function references etc. As someone who grew up on 'C', it seems a bit weird to not have an 'include' mechanism and its headers. Does the it matter what order the files appear in the impor

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-02-03 Thread Ian Lance Taylor
On Mon, Feb 3, 2020 at 8:13 AM Craig Rodrigues wrote: > > Regarding the fact that I should not call flag.Parse() from inside an init() > method in my_test.go file, > if a note for this is not added to the documentation at > https://golang.org/pkg/flag/#Parse , > how would an end user know about

[go-nuts] Re: Anomaly in RunCommand and the exit status of the child process

2020-02-03 Thread Brian Candler
I just tried this on CentOS 7.4: # *script -e -q -c "date; exit 1"; echo $?* Mon 3 Feb 19:21:17 GMT 2020 1 # *script -e -q -c "date; exit 1" https://groups.google.com/d/msgid/golang-nuts/3fea01f3-115a-4523-af6b-544bdab810f1%40googlegroups.com.

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-02-03 Thread Tamás Gulácsi
2020. február 3., hétfő 17:13:26 UTC+1 időpontban Craig Rodrigues a következőt írta: > > > > On Friday, January 31, 2020 at 1:56:49 PM UTC-8, Ian Lance Taylor wrote: >> >> On Fri, Jan 31, 2020 at 10:33 AM Craig Rodrigues >> wrote: >> > >> > Thanks for the response. I have a few questions. >>

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-02-03 Thread Craig Rodrigues
On Friday, January 31, 2020 at 1:56:49 PM UTC-8, Ian Lance Taylor wrote: > > On Fri, Jan 31, 2020 at 10:33 AM Craig Rodrigues > wrote: > > > > Thanks for the response. I have a few questions. > > > > 1. In https://golang.org/pkg/flag/#Parse , would it be appropriate to > add a warning to

[go-nuts] Re: go mod vendor command leads to LF will be replaced by CRLF warning

2020-02-03 Thread 'Bryan C. Mills' via golang-nuts
`go mod vendor` copies in the files as found in the repository. It does not normalize them according to your local .gitattributes. (In fact, the `go` command intentionally ignores attribute-based transformations when downloading modules: see https://golang.org/issue/27153.) On Friday, January