[go-nuts] Re: Go Module and Build Tag

2020-01-30 Thread Henry
Got it. Thanks. On Wednesday, January 29, 2020 at 3:13:46 PM UTC+7, Volker Dobler wrote: > > Build tags are per build, not per package. > So no, you cannot. > > V. > > On Wednesday, 29 January 2020 04:03:15 UTC+1, Henry wrote: >> >> Hi, >> >> I wonder whether it is possible to specify a dependency

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

2020-01-30 Thread Craig Rodrigues
On Thursday, January 30, 2020 at 10:06:36 PM UTC-8, Ian Lance Taylor wrote: > > On Thu, Jan 30, 2020 at 9:43 PM Craig Rodrigues > wrote: > > I see here that this might be related: > https://golang.org/doc/go1.13#testing > > > > Testing flags are now registered in the new Init funct

Re: [go-nuts] Re: go1.12.16 not tagged on release-branch.go1.12?

2020-01-30 Thread Steve Mynott
To answer my own question https://go-review.googlesource.com/c/go/+/217066 Cheers Steve On Wed, 29 Jan 2020 at 17:48, Tyler Compton wrote: > I think it's very reasonable to ask a simple Git workflow question on > golang-nuts without having to provide reproduction steps. > > Yes, I posted the e

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

2020-01-30 Thread Ian Lance Taylor
On Thu, Jan 30, 2020 at 9:43 PM Craig Rodrigues wrote: > > I ran a quick experiment in my source tree, and saw a difference in > the behavior of "go test -c" between go 1.12 and go 1.13. > > EXPERIMENT 1: using docker image golang:1.12-alpine with go1.12.16 > linux/amd64 > --

[go-nuts] stream error: stream ID XXXXXX; NO_ERROR

2020-01-30 Thread Stan Tsouvallas
Hi, I'm seeing some pretty weird behaviour when sending HTTP requests between two services that I run. When I scale up traffic (approx 600k requests/min) I start to see a lot of occurrences of stream error: stream ID XX; PROTOCOL_ERROR on my client (resp, err := httpClient.Do(req)), and s

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

2020-01-30 Thread Craig Rodrigues
Hi, I ran a quick experiment in my source tree, and saw a difference in the behavior of "go test -c" between go 1.12 and go 1.13. EXPERIMENT 1: using docker image golang:1.12-alpine with go1.12.16 linux/amd64 --

[go-nuts] html/template: Unable to execute a method on non-pointer struct where method receiver is a pointer (can't evaluate field error)

2020-01-30 Thread John
[non-pointer struct]. cannot be invoked directly in a template. package main import ( "fmt" "bytes" "html/template" ) type Wrapper struct { raw []int } func (w *Wrapper) IsZero() bool { if len(w.raw) == 0{ return true } return false } var tmplText = ` {{.IsZero}} ` var tmpl = template.Mus

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

2020-01-30 Thread Manlio Perillo
On Thursday, January 30, 2020 at 6:18:36 PM UTC+1, ohir wrote: > > Dnia 2020-01-30, o godz. 05:50:36 > Manlio Perillo > napisał(a): > > > > [...] > But it calls for other solution. Namely: > > === > > Gofmt should have -u for "unformat" and -g for "format for a git difftool" > functionalit

[go-nuts] Re: Load function from golang.org/x/tools/go/packages throws "argument list too long" error

2020-01-30 Thread adam.welc via golang-nuts
The answer to both of the questions is that I followed this examples from the ssa package (LoadWholeProgram): // Load, parse, and type-check the whole program. cfg := packages.Config{Mode: packages.LoadAllSyntax} initial, err := packages.Load(&cfg,

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

2020-01-30 Thread Wojciech S. Czarnecki
Dnia 2020-01-30, o godz. 05:50:36 Manlio Perillo napisał(a): > alignment should be done by the editor, not gofmt. What you just said can be translated to: "editors must support Go meaning of tab characters" > Of course the tab is elastic **only** for a struct fields. Now it adds:

Re: [go-nuts] annoing: runtime error: cgo argument has Go pointer to Go pointer

2020-01-30 Thread Jake Montgomery
On Thursday, January 30, 2020 at 2:31:59 AM UTC-5, Andreas Otto wrote: > > > > Am Mittwoch, 29. Januar 2020 23:19:34 UTC+1 schrieb Bruno Albuquerque: >> >> One way to work this around is to use https://github.com/mattn/go-pointer >> . >> >> >> thanks, but also use this kind of "*HASH based and ex

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

2020-01-30 Thread Mine GO BOOM
Code is looked at by more than just your favorite editor. I know some people who still open up Notepad to do some quick edits. I cat code all the time. gofmt ensures that every way you look at the code, be it through a terminal, one or two lines at a time, a web browser, a diff tool, or the mos

[go-nuts] [ANN] Olric: Distributed cache and key/value store. Embedded Go library or language-independent service.

2020-01-30 Thread Burak Sezer
Olric: Distributed cache and key/value store. It can be used both as an embedded Go library and as a language-independent service. With Olric, you can instantly create a fast, scalable, shared pool of RAM across a cluster of computers. - Designed to share some transient, approximate, fast

[go-nuts] Re: Load function from golang.org/x/tools/go/packages throws "argument list too long" error

2020-01-30 Thread Manlio Perillo
On Wednesday, January 29, 2020 at 11:12:40 PM UTC+1, adam...@uber.com wrote: > > I am trying to analyze a large application using Go's static analysis > support. I am using the "packages" > package to load all > application packages using the Lo

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

2020-01-30 Thread Manlio Perillo
Of course the tab is elastic **only** for a struct fields. gofmt will continue to format other code normally. Struct fields are the only block of code that gofmt will align automatically, and the alignment may change is you add or remove a field. Manlio Perillo On Thursday, January 30, 2020 at

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

2020-01-30 Thread Manlio Perillo
Yes. In fact I wrote that alignment should be done by the editor, not gofmt. Manlio Perillo On Thursday, January 30, 2020 at 1:46:37 AM UTC+1, kortschak wrote: > > I suspect Manlio was referring to something like this > http://nickgravgaard.com/elastic-tabstops/. > > Dan > > On Thu, 2020-01-

Re: [go-nuts] Why is go too slow?

2020-01-30 Thread Jesper Louis Andersen
There is a point I want to add to the excellent discussion. When your benchmark is small, it becomes far more susceptible to which particular compiler optimizations that triggered. This means even small optimizations which manage to reduce instruction count, memory bandwidth usage, and register pr

[go-nuts] Re: annoing: runtime error: cgo argument has Go pointer to Go pointer

2020-01-30 Thread Tamás Gulácsi
2020. január 30., csütörtök 8:27:14 UTC+1 időpontban Andreas Otto a következőt írta: > > > > Am Donnerstag, 30. Januar 2020 06:15:28 UTC+1 schrieb Tamás Gulácsi: >> >> What does "argv" hold? >> >> Can it be a concrete type, not an interface ? That would allow passing it >> - or if you copy it to

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

2020-01-30 Thread Wojciech S. Czarnecki
Dnia 2020-01-30, o godz. 00:46:05 Dan Kortschak napisał(a): > I suspect Manlio was referring to something like this > http://nickgravgaard.com/elastic-tabstops/. Could be. So a small correction: s/agreed constant width of the tab/agreed width of the tab/ Where width can be "elastic".

Re: [go-nuts] Re: Is it considered to separate runtime and cmd/compile irrelevant standard libraries out from the core language repo and hosted in a different module, eg. std?

2020-01-30 Thread changkun
Dear Ian, Don't worry, I didn't mean to give suggestions about how the Go team should work, apparently your past decade experience is more convenient than any whimsicality. Besides, I believe the Go team's decision is much sophisticated and better, I was randomly posted this and see if I can f