[go-nuts] Vendor compilation problem

2018-01-31 Thread Dave Cheney
Can you please provide the output from running to eng. It looks like your GOPATH variables is either not set, or not set to the correct value, which looks to be in this case /home/vuco/repos/gopkg -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

[go-nuts] Vendor compilation problem

2018-01-31 Thread Dave Cheney
Hi, Can you please provide the output from running, go env It looks like your GOPATH variables is either not set, or not set to the correct value, which in this case looks to be, /home/vuco/repos/gopkg -- You received this message because you are subscribed to the Google Groups "golang-nuts

Re: [go-nuts] Conditional compiling for android

2018-02-01 Thread Dave Cheney
The build system considers android and Linux to be the same for historical reasons. -- 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...@goog

[go-nuts] net.Pipe doesn't support deadlines

2018-02-03 Thread Dave Cheney
Which version of Go are you using? https://github.com/golang/go/blob/master/src/net/pipe.go#L224 -- 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+unsu

[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-08 Thread Dave Cheney
But that’s the problem, who’s default uuid format is chosen? And how to justify this over the other users who want their default to be chosen. The answer is as it currently stands, multiple uuid libraries exist outside the standard library. Can you tell me, in concrete terms, what are the ben

[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-08 Thread Dave Cheney
Your argument that the stdlib grows a uuid package is really a call for stability. “3rd parties cannot provide us the stability we need, so the go team must”. I don’t think that is a fair expectation on the go team, especially as there is no clear standard for what a uuid is (having multiple inp

[go-nuts] Re: is there an atexit?

2018-02-09 Thread Dave Cheney
Your program has a data race in the exitcode variable. -- 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. For more options

[go-nuts] Go on MIPS32

2018-02-15 Thread Dave Cheney
cgo is not go. -- 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. For more options, visit https://groups.google.com/d/opto

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread Dave Cheney
I certainly don’t want what happened to C++ to happen to Go. If it’s a choice between obsolescence or being crushed under the weight of self inflicted complexity, I’ll gladly vote with my feet for the former. -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
In Go 1.4 the project contained both .go files and .c files. It shipped with two compilers, a go compiler, called gc, and a c compiler called cc. > /go/src/cmd/gc/go.y This is the input file for the yacc grammar for the Go 1.4 go compiler > /go/src/cmd/cc/cc.y This is the input file for the y

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
I feel like we’ve had this same discussion a few months ago. Ian has mentioned that go 1.4 is no longer in use (it exists only in a very special case or bootstrapping from source). Can you please give some context to your questions so we may assist you better. -- You received this message beca

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
> what files require the c compiler? The c files in the go 1.4 distribution. -- 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

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
> which files require go-c compiler? The ones in the go 1.4distributuon that end in .c. -- 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...@

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
n /src/ compile using own c-compiler?! > > On Monday, February 19, 2018 at 2:49:40 AM UTC+3:30, Dave Cheney wrote: >> >> > which files require go-c compiler? >> >> The ones in the go 1.4distributuon that end in .c. >> > -- You received this message

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
;> >> On Monday, February 19, 2018 at 2:49:40 AM UTC+3:30, Dave Cheney wrote: >>> >>> > which files require go-c compiler? >>> >>> The ones in the go 1.4distributuon that end in .c. >>> >> -- You received this message because you ar

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
In theory, yes. In practice, I doubt it. On Monday, 19 February 2018 10:37:14 UTC+11, Compiler wrote: > > Can build only c(own) compiler using a c compiler(like gcc) without go > from this source?! > > > On Monday, February 19, 2018 at 2:48:26 AM UTC+3:30, Dave Cheney wrote:

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
tten in a mixture of Go, C, and Assembly. >> >>> >>> On Monday, February 19, 2018 at 3:01:35 AM UTC+3:30, Compiler wrote: >>>> >>>> mean all `.c` file in /src/ compile using own c-compiler?! >>>> >>>> On Monday, February 19, 201

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
Stop. What do you want to do? Do you want to write a C compiler ? On Monday, 19 February 2018 10:47:24 UTC+11, Compiler wrote: > > https://groups.google.com/forum/#!topic/golang-nuts/24pSm-B3FqU > > On Monday, February 19, 2018 at 3:14:48 AM UTC+3:30, Dave Cheney wrote: >>

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
er : self compiler > > On Monday, February 19, 2018 at 3:22:27 AM UTC+3:30, Dave Cheney wrote: >> >> Stop. >> >> What do you want to do? >> >> Do you want to write a C compiler ? >> >> On Monday, 19 February 2018 10:47:24 UTC+11, Compiler wrote: >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
I recommend watching this presentation from Russ Cox about why the Go team decided to rewrite the compiler from C to Go. https://www.youtube.com/watch?v=QIE5nV5fDwA On Monday, 19 February 2018 11:44:23 UTC+11, Compiler wrote: > > Performance of C with Optimize not better of Go at more time?! >

[go-nuts] Re: Dero: CryptoNote protocol + smart contracts using golang

2018-02-18 Thread Dave Cheney
Is there a reason DERO chose to go with their own licence rather than a BSD, MIT, or Apache 2 licence? On Monday, 19 February 2018 16:10:14 UTC+11, 867crypt...@gmail.com wrote: > > Hello, my name is Serena, I’m the Community Manager at a blockchain > project called Dero. We use a protocol calle

[go-nuts] Re: Build started to fail with 1.10

2018-02-23 Thread Dave Cheney
The failing line was added in december last year, https://github.com/golang/go/commit/7cba779cea5#diff-56c7df71bce32f8e50115128ae30941eR13 This also adds a dependency on time.h. Is time.h available in your build container? On Friday, 23 February 2018 20:09:02 UTC+11, Владислав Митов wrote: > >

[go-nuts] Is this a bug?

2018-02-25 Thread Dave Cheney
Type C conforms to the T1 interface? What did you expect? -- 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. For more opti

Re: [go-nuts] How to interpret runtime._ExternalCode in a profile?

2018-02-25 Thread Dave Cheney
I don't understand how that could happen. time.Now calls time.now (which is in assembly) so the former shouldn't be inlined, or omitted from profiling. On Monday, 26 February 2018 14:02:13 UTC+11, Caleb Spare wrote: > > On a hunch, I profiled a benchmark which just calls time.Now in a loop. > In

Re: [go-nuts] How to interpret runtime._ExternalCode in a profile?

2018-02-26 Thread Dave Cheney
Ahh, thank you. That was the missing piece of my understanding. -- 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. For mor

[go-nuts] Re: constructors vs lazy initialization

2018-03-03 Thread Dave Cheney
I prefer the later when possible because it enables callers to use the zero value of a type without explicit initialisation. On Sunday, 4 March 2018 11:37:43 UTC+11, Anmol Sethi wrote: > > How do you guys choose between constructors and lazy initialization? > > For example. > > Struct constructor

[go-nuts] $PATH error.

2018-03-04 Thread Dave Cheney
Under the hood go get shells out to git to fetch source code. You need to install git. -- 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...@g

Re: [go-nuts] Pass by value in struct not yielding expected result

2018-03-06 Thread Dave Cheney
On Wednesday, 7 March 2018 07:39:56 UTC+11, andrey mirtchovski wrote: > > maybe this will give you a hint: https://play.golang.org/p/ANIjc3tCdwp > > maps are reference types, but they still get passed by value. > Maps are pointers, pointers are values. -- You received this message because yo

[go-nuts] Re: Windows cgo complier

2018-03-29 Thread Dave Cheney
This windows build dependencies are captured here, https://github.com/golang/go/wiki/WindowsBuild On Thursday, 29 March 2018 00:17:32 UTC+11, Luke Mauldin wrote: > > Can someone please tell me what the golang team uses as the reference > windows x64 compiler? I have heard references to mingw64 b

[go-nuts] blocking profiler

2018-03-30 Thread Dave Cheney
It looks like you’re stopping the block profile immediately after starting it. Try github.com/pkg/profile which will take care of the plumbing for you. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

[go-nuts] Re: Scheduler discrepancy between Linux and OS X with Gosched()

2018-04-02 Thread Dave Cheney
A printf, especially the first one in the program is likely to cause the goroutine going off to the write(2) syscall to block long enough that a new thread is created to replace it. Once the original thread comes back from the syscall it will find that it has nothing to do, as you set runtime G

[go-nuts] Re: blocking profiler

2018-04-03 Thread Dave Cheney
I’ve not seen that problem before. I’d hazard a guess that it’s an incorrect go installation. Don’t set goroot, basically ever. But it’s just a guess. Are you able to create a stand alone program that demonstrates the issue with the profile? Please consider raising a bug, golang.org/issue/new

[go-nuts] Re: Scheduler discrepancy between Linux and OS X with Gosched()

2018-04-03 Thread Dave Cheney
> But is it not guaranteed that runtime.Gosched() will at least check if another goroutine is runnable? It checks, but I believe that at the time that it checks there are often no other runnable goroutines. The execution tracer will give you the answer to this. On Wednesday, 4 April 2018 04:12

[go-nuts] Re: blocking profiler

2018-04-04 Thread Dave Cheney
et support for their product. On Wednesday, 4 April 2018 21:52:08 UTC+10, sothy shan wrote: > > > > On Tuesday, April 3, 2018 at 4:50:36 PM UTC+2, Dave Cheney wrote: >> >> I’ve not seen that problem before. I’d hazard a guess that it’s an >> incorrect go installation. Don

[go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-05 Thread Dave Cheney
Indeed. Please do not conflate popularity with ubiquity. Formula one is a very popular sport, but not everyone needs to do 180mph down the straight away for their daily commute. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

[go-nuts] Why isn't os.File an interface?

2018-04-09 Thread Dave Cheney
Please have a read of my talk on solid from 2016. https://dave.cheney.net/2016/08/20/solid-go-design Tldr: define an interface with the behaviour of the os.File that your function/method expects. -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

[go-nuts] Fancy Comments & Documentation

2018-04-19 Thread Dave Cheney
Try putting a blank line between your comment block and the next symbol. This will break the association between the comment block and the symbol and hide the former. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

[go-nuts] schollz/peerdiscovery - Pure-Go library for cross-platform local peer discovery using UDP broadcast

2018-04-24 Thread Dave Cheney
Looking at the code for Discover it is possible you are discarding several errors whose contents may explain the issue you see on windows. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] how do i upgrade to latest version of go?

2018-04-24 Thread Dave Cheney
It depends on how you installed ypthe previous version of go. Home brew is popular on the Mac so follow their instructions for upgrading a package installed via brew. If you used one of the options from the golang org website, simply remove /usr/local/go and follow the instruction on the websi

Re: [go-nuts] Go list returning directory starting with underscore on Ubuntu

2018-04-24 Thread Dave Cheney
If the path start with _ then it is not within the list of directories in your GOPATH. -- 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...@g

Re: [go-nuts] How does time reported by go test relate to the wall clock time?

2018-04-27 Thread Dave Cheney
Try upgrading to go 1.10. You’ll get build and test caching for free and you’ll see a small variance between the timings you reported. -- 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

[go-nuts] Re: Goroutines memory leak

2018-04-30 Thread Dave Cheney
The leak is here httpClient := &http.Client{Timeout: timeout, Transport: &http.Transport{Dial : dialer.Dial}} If the httpClient value goes out of scope the connections attached to that will leak, along with their associated goroutines. On Monday, 30 April 2018 07:56:43 UTC+2, Tamás Gulácsi wrot

[go-nuts] Re: Windows OneDrive issue ..

2018-05-04 Thread Dave Cheney
This is issue https://github.com/golang/go/issues/22579 On Tuesday, 1 May 2018 20:38:26 UTC+2, xiof...@gmail.com wrote: > > I just discovered a problem running/compiling files that are > accessed/backed up by windows OneDrive > > (don't know when this started - worked a couple of months ago..) >

Re: [go-nuts] Re: go 1 on Ubuntu 18.04

2018-05-07 Thread Dave Cheney
Top tip: you never need to set GOROOT. Please don’t set GOROOT, it’ll just cause confusing errors for you in the future. -- 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 e

Re: [go-nuts] Re: go 1 on Ubuntu 18.04

2018-05-08 Thread Dave Cheney
Please allow me to clarify, anyone other than Jan never needs to set GOROOT. -- 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

Re: [go-nuts] Re: Go license and fitness for purpose

2018-05-17 Thread Dave Cheney
Thank you to all those who contributed to this thread. While many Go programs are written under open source licences, and many Go programmers contribute to open source in a professional or personal capability, it is now time to bring the discussion to a close as this thread has moved outside th

[go-nuts] Re: How can I get the last followed URL use http.Client on 302 Redirections?

2018-05-21 Thread Dave Cheney
Please keep in mind that the Via header is supplied by he client (the browser) and there is not requirement that it maintains the full chain of custardy of all the urls it has passed though, nor is there any way for Go to know nor enforce that this list remains accurate. Sorry. -- You receive

[go-nuts] Performance hit when using goroutine

2018-05-22 Thread Dave Cheney
The best tool to investigate this problem is the execution tracer. It will show you the activity of goroutines over time making is easy to spot contention. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Performance hit when using goroutine

2018-05-22 Thread Dave Cheney
The execution tracer will show this as it tracks resources that goroutines block on. Seriously I’m just going to keep suggesting the execution tracer until you try it :) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: How should I avoid - literal copies lock value from

2018-08-07 Thread Dave Cheney
Pass a pointer, *Set into your Diff method. -- 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. For more options, visit htt

[go-nuts] buffer.WriteString Error case

2018-08-07 Thread Dave Cheney
So that it can be used interchangeably with *bufio.Writer. -- 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. For more opt

[go-nuts] go go1.10.3 fatal error: runtime: netpoll failed

2018-08-07 Thread Dave Cheney
As Ian explained on the GitHub issue you raised, RHEL5 is not supported by any version of Go - the 2.6.18 kernel is below our minimum requirements. Dave -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] How to signal(sigint) blocking goroutine

2018-08-10 Thread Dave Cheney
The context value you pass into record isn't used and running record in its own goroutine doesn't really add anything because the main goroutine just waits for the other goroutine to exit. The exit the second goroutine will be at least 1 second, but could be much longer. On Saturday, 11 August

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-12 Thread Dave Cheney
This is likely to be issue https://github.com/golang/go/issues/599, https://play.golang.org/p/zZm-6zWwFoi On Monday, 13 August 2018 01:29:43 UTC+10, Stephan Mühlstrasser wrote: > > Hi, > > I'm developing my first Go program that is supposed to upload files into a > Google Cloud Storage bucket f

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
No, it’s not a cross compilation issue. Well, yes and no, the rpi is a 32 bit platform so some structures have a different size causing the offset of the field to be 32 but aligned, not the required 64 bit aligned. The play example shows the address of the field is not aligned on a 8 byte boun

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
I don’t think that will help. The problem is not cross compilation. The problem is when run in a 32bit environment the offset of that field is not guaranteed to be aligned to 8 bytes. You’ve got a 50/50 chance that each allocation will be properly aligned. -- You received this message because

[go-nuts] Re: Extending deadline for logging

2018-08-15 Thread Dave Cheney
On Thursday, 16 August 2018 12:15:57 UTC+10, r...@google.com wrote: > > As an example: > Client calls MyService with a deadline of 10 seconds. > MyService calls OtherService as part of responding. However, the call to > OtherService times out due to the deadline in 10 seconds. > MyService tries

Re: [go-nuts] Re: Extending deadline for logging

2018-08-15 Thread Dave Cheney
hat to OtherService, with > the expectation that there should be x seconds left over for the write to > spanner. > > On Wed, Aug 15, 2018 at 8:10 PM Dave Cheney wrote: >> >> >> >> On Thursday, 16 August 2018 12:15:57 UTC+10, r...@google.com wrote: >>> &

Re: [go-nuts] Re: Extending deadline for logging

2018-08-16 Thread Dave Cheney
n, what happens to the error, is it dropped? On Thursday, 16 August 2018 14:44:08 UTC+10, Dave Cheney wrote: > > What would happen if you write the error to spanner with a setting > context.Backgrond(), ie, no deadline? > > On 16 August 2018 at 13:57, Robert Bartoszynski wro

[go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-19 Thread Dave Cheney
Point of clarification, the package name doesn’t contain a dot, that is not permitted by the syntax of the package declaration. The name of the directory you placed the file in ends in .go and this is confusing the tool. If this is a regression from an earlier version of Go, please raise an iss

Re: [go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-20 Thread Dave Cheney
Thanks for confirming this is a regression. On 20 August 2018 at 18:41, Shulhan wrote: > On Sun, 19 Aug 2018 16:13:00 -0700 (PDT) > Dave Cheney wrote: > >> Point of clarification, the package name doesn’t contain a dot, that >> is not permitted by the syntax of the package

Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-23 Thread Dave Cheney
Hi, Can you please do two things to help with this error report. 1. Please include the entire data race report -- we need this to match up the line with the source code you've provided in the gist 2. Please double check that you are not copying a your sync.Pool type by value, this can happen if

[go-nuts] Re: Working or Not

2018-09-02 Thread Dave Cheney
Hi John Unless the variables a1, a2, a3, b1, ... are defined in the same package as your showBoard function, ie var a1, a2, a3 int then Go will report that they are undefined. Unlike some other languages, Go does not implicitly define a variable on first occurance. All variables must be defin

[go-nuts] Performance regression of HTTP requests since Go 1.11

2018-09-05 Thread Dave Cheney
Can you post the output from httpstat? -- 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. For more options, visit https://g

[go-nuts] Re: Performance regression of HTTP requests since Go 1.11

2018-09-05 Thread Dave Cheney
This looks like an issue related to dns resolution in your environment with go 1.11. I suggest building a reproducer using the net,Lookup* functions as the net/http package is not the problem. Once you have a reproduction case, please log an issue golang.org/issue/new Thanks. -- You recei

[go-nuts] Re: Opening brace can't be placed on a separate line killing the language for me

2018-09-08 Thread Dave Cheney
I'm sorry you feel this way. The reality is that the format of the language is not something that is going to change. I personally don't like that I cannot write one liner functions on one line because of gofmt's preference for reformatting the same function over three lines -- but, I put this

[go-nuts] Re: go 1.11 and XP

2018-09-10 Thread Dave Cheney
Go 1.11 doesn't support XP. We don't test on XP and won't fix bugs reported against XP systems any more. If it's working for you, great!, but if it breaks, you get to keep both pieces. Dave On Tuesday, 11 September 2018 05:05:23 UTC+10, wilk wrote: > > Hi, > > Go 1.11 is not more compatible wi

[go-nuts] Re: Ambiguity in generic interfaces

2018-09-13 Thread Dave Cheney
I think D solved this quite well https://dlang.org/spec/template.html In your example this might become type Foo(type T) interface {} type Bar(type T) interface { Foo!(T) } The exclamation point makes it clear this is the application of a T to the existing interface type Foo(type T). On Fr

Re: [go-nuts] Periodic task when time.Ticker and time.Sleep are pretty expensive

2018-09-17 Thread Dave Cheney
I've confirmed this uses 14% on a random OS X machine. Please raise a bug, https://golang.org/issue/new On Monday, 17 September 2018 14:29:44 UTC+10, Robert Engels wrote: > > For reference, similar code under Java consumes 2.5 % CPU. > > I tested the Go code under OSX, and it is roughly 10%, whic

[go-nuts] Re: Run time error

2018-09-18 Thread Dave Cheney
Assuming you are using the master branch of go-ifps-api, this request is failing because RequestBuilder.shell is nil. This could happen for a variety of reasons, perhaps the lack of error handling in NewLocalShell. I recommend you handle this with the ipfs developers on https://github.com/ipfs

[go-nuts] Re: Tour Of go Page 8 in Basics does not work.

2018-09-18 Thread Dave Cheney
It looks like the playground has cached this error. Please raise an issue, https://golang.org/issue/new and someone with admin powers will delete the faulty entry. On Tuesday, 18 September 2018 17:03:00 UTC+10, Reinhard Luediger wrote: > > Hey List, > > is this the right place to get the tour of

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
pkg /profile will do the paperwork for you so ^C works when profiling. -- 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.

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
kage > from the stdlib which gave me what i wanted. >> On Tue, Sep 18, 2018 at 7:55 PM Dave Cheney wrote: >> >> pkg /profile will do the paperwork for you so ^C works when profiling. >> >> -- >> You received this message because you are subscribed to the Google

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Dave Cheney
Thank you to everyone who has contributed to this thread. It is time for everyone to take a break for 48 hours. After this time if you feel strongly that there is a point which you must continue to debate please do so, but be mindful that many words have already been spent in this thread and t

[go-nuts] Re: Local variable escapes to heap

2018-09-19 Thread Dave Cheney
If you pass more -m's to the compiler it will explain why Daves-MacBook-Pro(~/src) % go build -gcflags=-m=2 buffer.go # command-line-arguments ./buffer.go:12:6: cannot inline main: function too complex: cost 108 exceeds budget 80 ./buffer.go:15:21: buffer escapes to heap ./buffer.go:15:21: f

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
I think because GOPATH is not set it is defaulting to $HOME/go (see Go 1.9 release notes, from memory). Try moving your code to another folder. On Friday, 21 September 2018 05:21:32 UTC+10, John wrote: > > Just started playing with modules recently. Having an issue I don't > understand, wonder

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
Sorry, I probably wasn’t clear or didn’t understand that you were asking. I saw that you said GOPATH is not set, it because your code is inside $HOME/go, because of the rules of the default gopath introduced in 1.8, gopath IS actually set. To be extra sure, when I’m playing with go modules I u

[go-nuts] Adding packages for the lang

2018-09-21 Thread Dave Cheney
Additions to the language are handled via a written proposal process. https://github.com/golang/proposal/blob/master/README.md -- 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

Re: [go-nuts] The If Statement: Switches are better except for a single condition (change my mind)

2018-09-24 Thread Dave Cheney
On Tuesday, 25 September 2018 10:22:52 UTC+10, Louki Sumirniy wrote: > > Using named return values and this construction you can drop all those > returns in each case block to outside the block. You only need to spend an > extra line if you have to break out of it by return or break. > Go is n

[go-nuts] idiomatic code to find, if executable exists in golang

2018-09-26 Thread Dave Cheney
Are you able to modify the original question. Why do you need to know if a binary exists? Presumably so you can execute it. If so then you can modify the original request and make the problem more tractable. -- You received this message because you are subscribed to the Google Groups "golang-

[go-nuts] Re: idiomatic code to find, if executable exists in golang

2018-09-26 Thread Dave Cheney
My suggestion is, rather than seeing if an executable exists, then executing it. Just execute it and if there is an error just pass it back to the caller. The difference between I tried to run the program but it wasn’t found and I tried to run the program but it failed for some reason shouldn’t

[go-nuts] Re: Canonical module arrangement in a multi-language project.

2018-09-27 Thread Dave Cheney
With the modules support added to Go 1.11 this should be straight forward. Create a subdirectory for your go code inside your working copy; change into that and run go mod init example.com/your/repo Where example.com/your/repo is a placeholder for the _prefix_ you want to apply to all of the

Re: [go-nuts] Is this implementation of weak pointers safe?

2018-09-30 Thread Dave Cheney
Please don’t take os.File as justification, it’s one of the few uses of a finaliser in the std lib. If it were being written today I would argue that instead of silently closing the file, it should panic if the resource falls out of scope unclosed. As always, remember that finalisers are not g

[go-nuts] Re: [golang-dev] does net.Conn.SetDeadLine makes syscall ?

2019-04-06 Thread Dave Cheney
by net.Conn > > bufr := bufio.newReader(netConn) > for numEntries >0 { > numEntries-- > netConn.setReadDeadline(timeNow().add(heartbeatTimeout) > entry.decode(bufr) > process(entry) > } > > thanks > Santhosh > > On Sat, Apr 6, 2019 at 4:09 PM Dav

[go-nuts] Re: No Allman-Style, No go!

2017-07-21 Thread Dave Cheney
Thank you for keeping the dream of this thread alive. -- 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. For more options,

[go-nuts] Re: golang-codereview - purpose

2017-07-22 Thread Dave Cheney
I read it. It lets me know which changes have been proposed. On Sunday, 23 July 2017 09:42:57 UTC+10, Carlos wrote: > > Hi, > > > I have subscribed golang-codereview list for a while. Even filtering out > for keywords, it is still a lot of emails. I'd assume that such list would > have a good re

Re: [go-nuts] Re: golang-codereview - purpose

2017-07-22 Thread Dave Cheney
yup On Sun, Jul 23, 2017 at 11:59 AM, Ulderico Cirello wrote: > Just confirming, you read all of it? > > Il giorno sab 22 lug 2017 alle ore 18:17 Dave Cheney ha > scritto: >> >> I read it. It lets me know which changes have been proposed. >> >> >> On Su

[go-nuts] Re: How to determine when to actually use goroutines?

2017-07-24 Thread Dave Cheney
This presentation, or more accurately, the summary at the end, may be of interest to you. https://dave.cheney.net/paste/concurrency-made-easy.pdf A recording of this presentation at GopherCon Signapore is also available by searching for those keywords. On Tuesday, 25 July 2017 01:34:30 UTC+10,

[go-nuts] Re: What is pprof overhead like when gathering a profile?

2017-07-24 Thread Dave Cheney
Here's an entirely unscientific method to determine the overhead of profiling. The Go distribution contains a set of basic benchmarks, one of which is a loopback based http client server benchmark. Running the benchmark with and without profiling gives a rough ballpark for the overhead of profi

[go-nuts] Re: What is pprof overhead like when gathering a profile?

2017-07-24 Thread Dave Cheney
Another option is to profile a % of requests. In the past I've done that by enabling profiling on a set % of application servers then extrapolating from there. On Tuesday, 25 July 2017 10:55:42 UTC+10, Jaana Burcu Dogan wrote: > > It would be very speculative to provide reference numbers without

[go-nuts] Re: Go import tree

2017-07-30 Thread Dave Cheney
This feature is enabled on any package you view through godoc.org; just look at the bottom of the page. On Monday, 31 July 2017 10:15:43 UTC+10, Steve Roth wrote: > > https://github.com/davecheney/prdeps is another. > Steve > > On Saturday, July 29, 2017 at 9:55:05 PM UTC-7, Tong Sun wrote: >> >>

[go-nuts] Re: pet peeve: it's Go not golang

2017-07-30 Thread Dave Cheney
> > Golang helps much, when searching for Go related programming issues all > over the internet > > Skip's point, which I heartily support, is here, on this forum, there is little ambiguity what people refer to when they talk about the programming language called Go. -- You received this me

[go-nuts] Re: Proper way to construct|format this code...

2017-07-30 Thread Dave Cheney
https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88 -- 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. For more

[go-nuts] Re: Socket Priority affect Read Deadline?

2017-08-02 Thread Dave Cheney
http://godoc.org/net#UDPConn.File "The returned os.File's file descriptor is different from the connection's. Attempting to change properties of the original using this duplicate may or may not have the desired effect." On Wednesday, 2 August 2017 23:34:16 UTC+10, jlu...@gmail.com wrote: > > Hi

[go-nuts] lock for assigning to different elements of an array

2017-08-02 Thread Dave Cheney
No, but anything reading from that array which is not the original writer will have to coordinate via a lock or channel to ensure a proper happens before relationship exists. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-02 Thread Dave Cheney
I'm not really sure what you are asking. I think your second paragraph got eaten by autocorrect at the critical point. Could try maybe asking your question in a different way? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Dave Cheney
e struct assuming they are word sized? Does this hold for all > architectures? > > I am sorry if I am still a bit unclear but I find it hard to ask properly > when I am a bit unsure of the topic. :D > > > > tors 3 aug. 2017 kl 07:49 skrev Dave Cheney : > >> I&#

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Dave Cheney
ave a data race as the waitgroup.done / wait creates a happens before relationship between reader and writer. On Thu, 3 Aug 2017, 17:33 Henrik Johansson wrote: > But isn't this what is happening in the example? Or is write-only not > sharing? > > On Thu, 3 Aug 2017, 09:23 Dave Ch

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Dave Cheney
On Thu, 3 Aug 2017, 17:39 Dave Cheney wrote: > Your first program has a data race, well it has two races, the first is a > data race between the goroutines writing to the slice and the println which > will read the contents of the slice. That is, if those writing goroutines > get a c

[go-nuts] Re: Error when using go tool trace

2017-08-03 Thread Dave Cheney
On Friday, 4 August 2017 15:46:39 UTC+10, Evan Leis wrote: > > I ran into this same problem, and found this post! > It looks like you're making the same simple mistake I was: > > # erroneous: > defer f.Close() > defer trace.Stop() > Defers run in LIFO order. This sample will call trace.Stop, the

  1   2   3   4   5   6   7   8   >