Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread 'Axel Wagner' via golang-nuts
On Tue, Mar 3, 2020 at 11:38 PM Warren Stephens wrote: > Look at the 2 things below. Which is more quickly comprehensible? We > cannot conceive of a way to have the upper one and still test each piece??? > I don't really understand the point you are trying to make here. To me, the upper one

Re: [go-nuts] How to find goroutines during debugging - aka goroutine labeling

2020-03-03 Thread Florin Pățan
I think the current solution is a perfectly reasonable solution. As I explained in the article, you can have 0 performance impact when used in production environments, because you can disable this feature. And when used in debugging environments, this has a minimal performance impact. For more

[go-nuts] Learning the runtime

2020-03-03 Thread buchanae
Is there any way to learn the internals of the runtime package, besides just reading all the code? There are a lot of types in the package with cryptic names and no documentation, so if all I have is the code, it's going to be a steep learning curve. -- You received this message because you

[go-nuts] Re: Go 1.14: how to -linkshared to a library produced by -buildmode=shared?

2020-03-03 Thread 'Bryan C. Mills' via golang-nuts
Did this work in 1.13? https://golang.org/issue/35759 is probably related; see especially the TODO here . Please file an issue so we don't lose

[go-nuts] go vet on playground emits message on printf %x with floating point

2020-03-03 Thread bupjae
Playground: https://play.golang.org/p/2j2PlKwiA7B Source code: package main import ( "fmt" ) func main() { fmt.Printf("%x\n", 5.0/7.0) } Expected: No message emits by go vet Actual: go vet emits the following message: ./prog.go:8:2: Printf format %x has arg 5.0 / 7.0 of wrong type

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Dan Kortschak
The answer to that question is entirely dependent on context, which is stripped by using anonymous labels as you have. For linear things, the second one is clearer, for hierarchical things the first is. It is entirely possible to test each piece of an hierarchical structure; this is the basis for

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Jason E. Aten
Gentle suggestion: put each step you want to be testable into its own function. AAA BBB www() CCC if xxx() { yyy() } DDD zzz() -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Go without garbage collector

2020-03-03 Thread Robert Engels
I think having a single specialization is nearly impossible in a real-world application for a structure like a matrix so I am not really sure of the value. It's kind of strange that they even call that a specialization - my (limited) understanding of specializations is when you write custom

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Warren Stephens
rog, Very well said -- but everyone keeps talking about improving the maintainability without talking about the "comprehensiblity". Look at the 2 things below. Which is more quickly comprehensible? We cannot conceive of a way to have the upper one and still test each piece??? Warren AAA

Re: [go-nuts] How to find goroutines during debugging - aka goroutine labeling

2020-03-03 Thread Robert Engels
This is awesome and sad. The marketplace is now steering Go - which was bound to happen. You can't ignore the needs of the marketplace and expect it to standstill. This is a clear feature that the Go team (and community) should of taken more seriously and a better solution would of been delivered.

Re: [go-nuts] Go without garbage collector

2020-03-03 Thread
> > On Tuesday, March 3, 2020 at 11:25:22 PM UTC+1, Robert Engels wrote: > A key statement in the link “ The JIT-generated code is significantly > faster than the ahead-of-time-generated code for small matrix sizes.” > > Which is what you were arguing was not possible... you can’t have it both

Re: [go-nuts] Go without garbage collector

2020-03-03 Thread
On Friday, February 14, 2020 at 6:57:08 PM UTC+1, ⚛ wrote: > > On Friday, February 14, 2020 at 6:46:51 PM UTC+1, Robert Engels wrote: >> >> Yes, and then the access and iteration is slower as it needs indirection >> to find the correct page. There is no free lunch. >> >> The caveats about using

Re: [go-nuts] Re: RFC Package structuring

2020-03-03 Thread Sam Whited
On Tue, Mar 3, 2020, at 10:09, Rizwan Iqbal wrote: > I would avoid multiple go.mod files in one repository as well. I > generally follow the rule of thumb, one module per repository. I generally follow this advice too, however, I make an exception for modules that don't need to be versioned. For

[go-nuts] Re: RFC Package structuring

2020-03-03 Thread Rizwan Iqbal
I would avoid multiple go.mod files in one repository as well. I generally follow the rule of thumb, one module per repository. On Saturday, 29 February 2020 19:03:34 UTC+1, Sankar wrote: > > I am starting a new project (say `hello`) and I am totally confused about > what package structure to

[go-nuts] Announcement to Go Event Organizers: Corona Virus COVID-19

2020-03-03 Thread 'Carmen Andoh' via golang-nuts
Following the latest guidance from organizations like CDC and WHO , Google is placing a ban on all international travel for employees, until further notice. With this

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread roger peppe
> In my current project [...], I have not found a single problem using programmed tests. Automated tests play more roles than just finding initial problems. Arguably more important is to guard against errors introduced when maintaining and updating the code over time (regression). Tests are also

[go-nuts] Re: Lot's of test errors in package zmq4 with Go version 1.14, no errors with earlier versions

2020-03-03 Thread Liam
https://github.com/golang/go/issues/36281 https://github.com/pebbe/zmq4/issues/17 On Wednesday, February 26, 2020 at 3:33:05 AM UTC-8, Peter Kleiweg wrote: > > With Go version 1.14 I get a lot of errors when I run: > > go test -v github.com/pebbe/zmq4 > > I didn't see this with Go 1.13.8 or

[go-nuts] How to find goroutines during debugging - aka goroutine labeling

2020-03-03 Thread Florin Pățan
Hello gophers, There have been a number of posts in the past discussing how to handle large number of goroutines in applications when it comes to debugging them. Since Delve, the Go debugger, and GoLand, the Go IDE from JetBrains, recently got the ability to handle these, I thought I'd share

Re: [go-nuts] Go 1.14 is released

2020-03-03 Thread Michel Casabianca
Hi Gophers, I have updated my list of Go interfaces for this new release: http://sweetohm.net/article/go-interfaces.en.html Enjoy! Le mar. 25 févr. 2020 à 22:39, Carlos Amedee a écrit : > Hello gophers, > > We just released Go 1.14. > > To find out what has changed in Go 1.14, read the

[go-nuts] Re: Trying to parse sitemap xml data into struct

2020-03-03 Thread C Banning
The sequence of struct members doesn't matter - https://play.golang.org/p/m0wZtHcPRcU On Tuesday, March 3, 2020 at 5:49:10 AM UTC-7, Kuldeep Avsar wrote: > > I wrote a program to extract data from sitemaps's as this format > > type URLSet struct { > Urls []SitemapURL `xml:"url"` > } > > type

[go-nuts] Trying to parse sitemap xml data into struct

2020-03-03 Thread Kuldeep Avsar
I wrote a program to extract data from sitemaps's as this format type URLSet struct { Urls []SitemapURL `xml:"url"` } type SitemapURL struct { Location string `xml:"loc"` LastModifiedDate string `xml:"lastmod"` ChangeFrequency string `xml:"changefreq"` Priority string `xml:"priority"` } but

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Warren Stephens
I really am not trying to be a pain about this "real world" thing -- think about trauma nurses and MASH surgeons. I have 2 friends that are trauma nurses who fly on rescue helicopters to car and motorcycle crashes (or occasionally a military location). They do not do things the same was as

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Bakul Shah
On Mar 1, 2020, at 12:43 PM, Ian Lance Taylor wrote: > > On Sun, Mar 1, 2020 at 8:21 AM Warren Stephens > wrote: >> >> // I don't want to get into the specific syntax of the test code directly, >> // but a test would start execution here, supplying "lines" and "thing2" >> // >>mystep2

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread peterGo
Fixed test. Warren, "The over-arching goal is for me to write tests more easily. Not avoid writing tests. I am not arguing against tests." Here is a quick fix of your code; ws.go: https://play.golang.org/p/KgQ0esiY0Xt Now, use rdr to quickly test countSomeStuff: ws_test.go: