Re: [go-nuts] A treemap implemented in go

2018-10-02 Thread Tristan Colgate
A couple of quick observations. This would be more useful as a package than a single program. You could move main into an example/ folder and keep the rest of the content in the top level as a package. Move the explanatory comment up as a Package comment. The standard library includes color

Re: [go-nuts] Re: How to setup your development environment using Go modules

2018-10-02 Thread Scott Cotton
Hi all, wanted to follow up to @thepudds summary below. I work with multiple modules. For me, I have found the following helpful 1. keeping dependencies acyclic 2. organising the granularity of what is the smallest module to be as coarse as possible, so there aren't too many modules and

[go-nuts] Re: Rule-swarm attacks can outdo deep reasoning

2018-10-02 Thread David Collier-Brown
In a previous life, two co-op students did the B-to-C conversion suite for Honeywell as a suite of transformations for use by developers. Ten years later, my team and I did porting tools that provided humans with advice, some of which was trivially sufficient, others were merely advisory. --

Re: [go-nuts] Re: allowed imports for go appengine

2018-10-02 Thread Dan Kortschak
I think that the project lead has decided to move to flex, so the issue has become moot. However, it would be nice for there to be some reasonably discoverable documentation for these things. The questions I would have had have been answered in what you wrote: we want to have outbound sockets

Re: [go-nuts] Rule-swarm attacks can outdo deep reasoning

2018-10-02 Thread Ian Denhardt
Worth noting, a related "translator's assistant" approach was taken when bootstrapping the go compiler to be self-hosting: * https://talks.golang.org/2014/c2go.slide#1 * https://github.com/rsc/c2go The output has stood the test of time. The approach is a bit more automated, at the cost of really

[go-nuts] Re: Go 1.11.1 is released

2018-10-02 Thread sc28
My bad -- Had installs in both /usr/local/bin and /usr/local/bin/go -- cleared everything and reinstalled -- sorry! On Tuesday, October 2, 2018 at 3:20:52 PM UTC-4, sc28 wrote: > > Just installed (Mac pkg version): > > Tried to compile simple "hello, world" > > > # errors > compile: version

[go-nuts] Re: Go 1.11.1 is released

2018-10-02 Thread sc28
Just installed (Mac pkg version): Tried to compile simple "hello, world" # errors compile: version "go1.11.1" does not match go tool version "go1.11" # internal/race compile: version "go1.11.1" does not match go tool version "go1.11" # unicode/utf8 compile: version "go1.11.1" does not match go

Re: [go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Perfect. Thanks so much! - Greg On Tuesday, October 2, 2018 at 12:13:12 PM UTC-7, Burak Serdar wrote: > > https://blog.golang.org/constants > > Foo is an untyped constant. Bar is a string. > On Tue, Oct 2, 2018 at 1:11 PM Greg Saylor > wrote: > > > > Also it would appear that foo("hello")

Re: [go-nuts] Re: string question

2018-10-02 Thread Burak Serdar
https://blog.golang.org/constants Foo is an untyped constant. Bar is a string. On Tue, Oct 2, 2018 at 1:11 PM Greg Saylor wrote: > > Also it would appear that foo("hello") succeeds to. > > - Greg > > > On Tuesday, October 2, 2018 at 12:05:04 PM UTC-7, Greg Saylor wrote: >> >> Hello, >> >> I'm

[go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Also it would appear that foo("hello") succeeds to. - Greg On Tuesday, October 2, 2018 at 12:05:04 PM UTC-7, Greg Saylor wrote: > > Hello, > > I'm trying to figure out why foo(Bar) is the only one of these function > calls that fails. It seems like foo(Foo) should to? > > package main > > >

[go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Should have mentioned I'm using go version go1.10.2 darwin/amd64 - Greg On Tuesday, October 2, 2018 at 12:05:04 PM UTC-7, Greg Saylor wrote: > > Hello, > > I'm trying to figure out why foo(Bar) is the only one of these function > calls that fails. It seems like foo(Foo) should to? > > package

[go-nuts] string question

2018-10-02 Thread Greg Saylor
Hello, I'm trying to figure out why foo(Bar) is the only one of these function calls that fails. It seems like foo(Foo) should to? package main type N string const Foo = "foo" const Bar = string("bar") const Baz = N("baz") func main() { foo(Foo) foo(Bar) foo(Baz) } func foo(n N) { }

[go-nuts] Re: Constraints for generics

2018-10-02 Thread Christian Surlykke
mandag den 1. oktober 2018 kl. 16.14.26 UTC+2 skrev komuW: > > I think you should add it to: > https://github.com/golang/go/wiki/Go2GenericsFeedback > Thanks for the pointer. I wasn't aware of that page. I've added it. br. Chr. -- You received this message because you are subscribed to

[go-nuts] Go 1.11.1 is released

2018-10-02 Thread Katie Hockman
Hello gophers, We have just released Go version 1.11.1, a minor point release. This release includes fixes to the compiler, documentation, go command, runtime, and the crypto/x509, encoding/json, go/types, net, net/http, and reflect packages. View the release notes for more information:

[go-nuts] Re: What can i transport in a channel?

2018-10-02 Thread jake6502
To expand on what Tamás said ... There is really nothing that is not safe to transport in a channel. But there are some considerations. For example if you transport an *http.**Response* then you will be making a copy on the way in and out of the channel. So that *may *not be safe, but it has

Re: [go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread Michael Jones
I’m so glad to read this! I’m away from my computer but feeling like I’d failed a Go skill test...I could not imagine a problem either. On Tue, Oct 2, 2018 at 6:38 AM Ian Lance Taylor wrote: > On Tue, Oct 2, 2018 at 6:21 AM, wrote: > > > > I'd like to understand the reasoning in Go better. >

Re: [go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread Ian Lance Taylor
On Tue, Oct 2, 2018 at 6:21 AM, wrote: > > I'd like to understand the reasoning in Go better. > > This code is allowed: > newlocalvar, _ := strconv.Atoi(somestring) > > And this code is forbidden: > somestruct.field, _ = strconv.Atoi(somestring) Please show us a complete example, perhaps in the

Re: [go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread Jan Mercl
On Tue, Oct 2, 2018 at 3:29 PM wrote: > This code is allowed: > newlocalvar, _ := strconv.Atoi(somestring) > > And this code is forbidden: > somestruct.field, _ = strconv.Atoi(somestring) It is not forbidden: https://play.golang.org/p/YYUWhcNtPQB -- -j -- You received this message because

[go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread flockemark44
Hi! :-) I'd like to understand the reasoning in Go better. This code is allowed: newlocalvar, _ := strconv.Atoi(somestring) And this code is forbidden: somestruct.field, _ = strconv.Atoi(somestring) At least it does not compile, and so far I have learned that the reason is you should not

[go-nuts] Rule-swarm attacks can outdo deep reasoning

2018-10-02 Thread Eric Raymond
Is promised in the thread on pytogo, I have blogged on the general topic of rule-swarm attacks in the domain of language transformation. http://esr.ibiblio.org/?p=8153 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] vendor binary-only-package and go mod

2018-10-02 Thread alex . boussinet
Hi, I'd like to know how to vendor binary-only-package using go mod. I have something working with GOPATH/pkg but starting with Go1.11, I end up with this error: go build github.com/myname/mylib: *missing or invalid binary-only package; > expected file ""* Looking at the source code

[go-nuts] Re: "go vet -shadow" and named return variable

2018-10-02 Thread T L
"go vet -shadow" checks short variable declarations only. On Monday, October 1, 2018 at 10:56:13 AM UTC-4, Pierre Durand wrote: > > My code: > package main > > func main() { > a := 1 > _ = func() { > a := 2 > _ = a > } > _ = func() (a int) { > a = 2 > return a > } > _ = a > } > > "go vet -shadow"

[go-nuts] Re: allowed imports for go appengine

2018-10-02 Thread Stanley Iriele
As mentioned elsewhere on this thread. Appengine flex allows you to use any golang package. Appengine standard is a different story. Appengine standard has come a long way, but generally speaking you can't use sockets, syscall, any package that imports syscall, and you can't make outbound http