[go-nuts] Re: goimports has been updated

2016-07-16 Thread Vince Prignano
I just noticed that import paths that start with an uppercase letter don't get imported automatically after the update. Looking at the code and https://github.com/golang/tools/blob/master/imports/fix.go#L651, I tried to change the behavior, using strings.ToLower on `lastTwoComponents` like:

[go-nuts] Re: How do I load a x509 certificate?

2016-07-16 Thread sunil . kidambi
Hello, this is 2016 and I am walking on this path now.. In the rootCA function and elsewhere, you have this line: derBytes, err := x509.CreateCertificate(rand.Reader, , , , rpriv) However, the last two parameters to this function, according to the golang refs

Re: [go-nuts] Re: why treat int and []int differently here?

2016-07-16 Thread Matt Harden
In that code, there is no silent conversion. In AddOne, the constant 1 is inferred to be of type Int (not int), and so you're just adding Int to Int to get another Int. On Sat, Jul 16, 2016 at 5:35 PM pi wrote: > Sorry my bad. Forget to add "in many cases" to last

Re: [go-nuts] Re: why treat int and []int differently here?

2016-07-16 Thread 'Axel Wagner' via golang-nuts
On Sun, Jul 17, 2016 at 1:52 AM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > On Sat, 2016-07-16 at 15:36 -0700, pi wrote: > > `type` is not `typedef` in Go. `type` introduces completely new type. > > Fortunately, Go can cast these types to base type silently, i.e. > > explicict > >

Re: [go-nuts] Re: why treat int and []int differently here?

2016-07-16 Thread Dan Kortschak
On Sat, 2016-07-16 at 15:36 -0700, pi wrote: > `type` is not `typedef` in Go. `type` introduces completely new type. > Fortunately, Go can cast these types to base type silently, i.e. > explicict > cast int(valueOfTI) is unnecessary. This is not true; a named concrete type is never silently

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Henrik Johansson
Really? Does it flatten dependencies or will I still have potentially more than one context package for example? On Sun, Jul 17, 2016, 00:11 William Madison wrote: > FWIW, go build in versions >= 1.6* is basically equivalent to what GB buys > us just with a different

[go-nuts] Re: log: why print prefix before the timestamp?

2016-07-16 Thread Diego Cena
I agree with Jacek and Matt. Write an own logger? Isn't log package purpose NOT to write just another logger library? On Tuesday, June 17, 2014 at 6:24:21 PM UTC-3, Jacek Masiulaniec wrote: > > Hi Nuts, > > The below code: > > log.SetPrefix("debug: ") > log.Print("foo bar ...") > >

Re: [go-nuts] Linking C dynamic library non-standard location

2016-07-16 Thread Danack
Hi Ian, On Saturday, 16 July 2016 20:05:26 UTC+1, Ian Lance Taylor wrote: > > > I'm suggesting that you need an additional option: -R > /temp/imagemagick-temp/lib. You need to set the runtime library > search path to point to the right directory. > > Thanks Ian, The command: go build

[go-nuts] why treat int and []int differently here?

2016-07-16 Thread T L
> package main > > func fi(i int) {} > func fis(is []int) {} > > type TI int > type TIS []int > > func main() { > var ti TI > fi(ti) // cannot use ti (type TI) as type int in argument to fi > > var tis TIS > fis(tis) // no problems! > } > > -- You received this message

Re: [go-nuts] How likely is a data race to allow arbitrary code execution?

2016-07-16 Thread Ian Lance Taylor
On Jul 16, 2016 12:35 PM, "Demi Obenour" wrote: > > On Sat, 2016-07-16 at 12:06 -0700, Ian Lance Taylor wrote: > > On Sat, Jul 16, 2016 at 11:36 AM, Demi Obenour > > wrote: > > > > > > > > > One more question: is racing on a map likely to crash due

Re: [go-nuts] How likely is a data race to allow arbitrary code execution?

2016-07-16 Thread Demi Obenour
On Sat, 2016-07-16 at 12:06 -0700, Ian Lance Taylor wrote: > On Sat, Jul 16, 2016 at 11:36 AM, Demi Obenour > wrote: > > > > > > One more question: is racing on a map likely to crash due to out- > > of- > > bounds reads, as opposed to out-of-bounds writes? > > Either is

Re: [go-nuts] Linking C dynamic library non-standard location

2016-07-16 Thread Ian Lance Taylor
On Sat, Jul 16, 2016 at 11:40 AM, wrote: > > On Saturday, 16 July 2016 18:08:59 UTC+1, Ian Lance Taylor wrote: > >> >> My guess is that you need to either pass -R /temp/imagemagick-temp/lib >> to the linker, which you can do by setting CGO_LDFLAGS, > > > I get the same

Re: [go-nuts] How likely is a data race to allow arbitrary code execution?

2016-07-16 Thread Demi Obenour
On Fri, 2016-07-15 at 22:19 -0700, Ian Lance Taylor wrote: > On Fri, Jul 15, 2016 at 9:21 PM,   wrote: > > > > I know that in Go a data race is undefined behavior. > > > > How likely is the undefined behavior likely to result in an > > exploitable > > security bug, where

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Mauro Toffanin
On 16/07/16 18:43, John Souvestre wrote: > [...] I might be wrong, but I believe that gvt > does not share most of gb's philosophy: Actually, I didn't write that gvt shares any of Gb's philosophies in the first place. I wrote that the two PM shares SOME ideas and pieces of code. Nothing else.

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Ian Lance Taylor
On Sat, Jul 16, 2016 at 5:29 AM, Henrik Johansson wrote: > For repeatable builds there are many ways and tools that work fine, Gb is > not unique in this respect. > > I don't get why this should be a controversial topic however. It seems to be > an issue only in the go

RE: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread John Souvestre
> Gb puts emphasis on reliable and reproducible builds; none of the other package managers have such feature, ... None? Isn't that the main purpose of a package manager. I see many which seem to do this in addition to gb, for example: godep, glide, govendor, and gvt. Perhaps you weren’t

Re: [go-nuts] Re: OS X Installer: Why modify $PATH instead of adding symbolic links to /usr/local/bin?

2016-07-16 Thread Chris Broadfoot
If it isn't the right way of doing things, it might be something we can change (for 1.8, probably). What's an installer meant to do if there's an existing binary or symlink at that location? On Jul 16, 2016 9:41 AM, "Dmitri Shuralyov" wrote: Can someone please explain the

RE: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread John Souvestre
> You would be surprised to know that gvt uses gb internally, > and both the projects exchange pieces of code and ideas ;) That's not the impression I get. I might be wrong, but I believe that gvt does not share most of gb's philosophy: 1) It is based on just gb-vendor, not the rest of gb.

[go-nuts] Re: OS X Installer: Why modify $PATH instead of adding symbolic links to /usr/local/bin?

2016-07-16 Thread Dmitri Shuralyov
> > Can someone please explain the thinking behind this design decision? Is it > more common on Linux to have a lot of path additions instead of symbolic > links to executables? Was this something that was discussed and decided > upon by the core team or just an arbitrary decision? > I'd

Re: [go-nuts] Re: why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread Jan Mercl
On Sat, Jul 16, 2016 at 1:51 PM Torsten Bronger < bron...@physik.rwth-aachen.de> wrote: > There still is a subtle asymmetry: a.b() is implicitly converted to ().b() if necessary. Why isn't f(v) implicitly converted to f() if necessary? Go does not do implicit conversions of types of run time

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Henrik Johansson
For repeatable builds there are many ways and tools that work fine, Gb is not unique in this respect. I don't get why this should be a controversial topic however. It seems to be an issue only in the go community. In all the other languages (newer more modern anyway) it is considered a solved

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Florin Pățan
On Saturday, July 16, 2016 at 11:34:12 AM UTC+1, Mauro Toffanin wrote: > > On 16/07/16 11:44, Florin Pățan wrote: > > I appreciate you like gb, it's an interesting tool, but you cannot > > explain why it's different compared to other solutions when it comes to > > those two particular problems

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Florin Pățan
I know that talk very well since I'm the one Dave called a "compiler" at ~5:14. All the arguments about what's reproducible or not get muted when using vendoring. However, in order for that to be more effective, releases for various packages should be versioned and that controlled via the

[go-nuts] Re: Strange results from append

2016-07-16 Thread T L
On Saturday, July 16, 2016 at 1:28:32 AM UTC+8, Evan Digby wrote: > > I can't reproduce this in go playground (yet), but under what > circumstances would/could/should: > > nss := []namespace.Namespace{ > append(ns, g2message.NamespaceWin...), > append(ns, g2message.NamespaceSpend...), > } > >

Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread Jan Mercl
On Sat, Jul 16, 2016 at 9:42 AM T L wrote: > is there any logic here? Or just a hard rule? https://play.golang.org/p/4YVDq2XLln -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] Streaming deflate - can't reliably read chunks as they arrive instead of the entire stream

2016-07-16 Thread Tamás Gulácsi
What if you create a new deflater for each message? And use a new Buffer, too! Maybe deflater reads too much into the followings. If this works, you can look into why Reset is not enough. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To