Re: [go-nuts] What does -fm mean as a suffix for a runtime function name?

2016-07-15 Thread Gregory Golberg
Ah got it , thanks... To clarify for others: https://play.golang.org/p/opxR_ZpX3R On Fri, Jul 15, 2016 at 6:26 AM, roger peppe wrote: > The semantic difference is that Type.Method takes the receiver as its > first argument, whereas value.Method does not (the value is part

Re: [go-nuts] Generation of Strings - generation

2016-07-15 Thread Michael Jones
Whatever they wanted, we've put far more into answering it than than they have in responding. I sent my response taking time from the Farnborough Air Show, not wanting their concerns to go unaddressed. Disappointed to see no following reply to all the good advice from everyone here. On Jul 15,

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

2016-07-15 Thread demiobenour
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 "exploitable" means more than just denial-of-service? I am looking for qualitative estimates here. Is it the kind of bug that would be almost

[go-nuts] Re: Strange results from append

2016-07-15 Thread Evan Digby
Hi Nate, Thanks for the suggestions. We've definitely backed off appending to a separate value. Our code ended up looking like this (the requirements were actually a bit more complex than the core example): func (n Namespace) Combine(with ...Namespace) Namespace { // Benchmarks show it's

[go-nuts] Re: Strange results from append

2016-07-15 Thread Nate Finch
it is almost always a bad idea to use append and assign the result to a different value than the thing you're appending to. i.e. always do this: ns = append(ns, foo...) and don't do this: bar := append(ns, foo...) The thing is, that in that last line, like in your code, bar and ns *might*

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

2016-07-15 Thread Florin Pățan
I feel this is a controversial statement. Godep can do this just as well, in fact any vendoring tool can do this, as long as you commit your dependencies. Can you plead elaborate how using gb changes an6 of this? Thank you. -- You received this message because you are subscribed to the Google

Re: [go-nuts] I get a "Invalid cast. " error when debuging

2016-07-15 Thread Nigel Tao
On Sat, Jul 16, 2016 at 2:33 AM, Konstantin Khomoutov wrote: > Support for Go in gdb is beleived to be suboptimal (and AFAIK the > situation in unlikely to change). Consider trying devle -- which is a > native debugger for Go. Just a small typo: devle should be

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Daniel Skinner
$HOME/local/src usage predates Go usage for me, and besides, the structure and content of a GOPATH has merit stretching beyond languages as a simple method for source organization. On Fri, Jul 15, 2016, 4:30 PM Dave Cheney wrote: > Why not put non go code in another directory

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

2016-07-15 Thread Nigel Tao
On Sat, Jul 16, 2016 at 6:03 AM, Adam Keeton wrote: > Is there a different implementation of deflate that you think I should try? I don't know of any. Sorry. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
On 15 July 2016 at 22:30, Dave Cheney wrote: > Why not put non go code in another directory tree? That seems much simpler. I agree with you and see where you're coming from. That was where my original hesitation came from, but... My $GOPATH is .local/src. Why set it anywhere

Re: [go-nuts] fmt.Printf("%v") panics where %#v doesn't

2016-07-15 Thread 'Chris Manghane' via golang-nuts
In your example, MyError2 does not have an Error() method so it is not called. From the fmt package docs (golang.org/pkg/fmt): - 3. If the %v verb is used with the # flag (%#v) and the operand implements the GoStringer interface, that will be invoked. - If the format (which is implicitly

Re: [go-nuts] fmt.Printf("%v") panics where %#v doesn't

2016-07-15 Thread Thorsten von Eicken
Yup, doesn't quite make sense to me that Error() is called if it's an embedded struct and not when it's a struct field. See https://play.golang.org/p/Vp6Y-RETWZ On Friday, July 15, 2016 at 2:03:25 PM UTC-7, Thorsten von Eicken wrote: > > You're probably correct, see this: > > package main > >

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Dave Cheney
Why not put non go code in another directory tree? That seems much simpler. -- 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

Re: [go-nuts] fmt.Printf("%v") panics where %#v doesn't

2016-07-15 Thread Matt Harden
This might make it clearer as well: https://play.golang.org/p/g3KdJUQRlK On Fri, Jul 15, 2016 at 2:03 PM Thorsten von Eicken wrote: > You're probably correct, see this: > > package main > > import ( > "fmt" > ) > > type MyError struct{ error } > type MyError2 struct { > foo

Re: [go-nuts] xorm - 4.3 - panic: gob: registering duplicate names

2016-07-15 Thread Ian Lance Taylor
On Fri, Jul 15, 2016 at 11:39 AM, DM wrote: > I am getting the below exception with xorm - 4.3 and golang 1.4.2. Any idea > what could be going wrong? Is this some known issue xorm - 4.3 or some thing > other going wrong? > > panic: gob: registering duplicate names for

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
Muahah. Well I'm sure I can speak for many people when I say we're grateful it's being improved! :) On 15 July 2016 at 21:03, Brad Fitzpatrick wrote: > I am just as relieved. Imagine the pain and frustration you felt on every > slow save but with an additional feeling of

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

2016-07-15 Thread Adam Keeton
I see. Thanks for the help! >You could possibly capture the bytes of each compressed message, and > then construct a new websocket-free program that starts with those > bytes and knows what each decompressed message should be. I went ahead and wrote some example code. It consists of two

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
Just saw this was merged - this is excellent. These latest changes bring the runtime down to 400ms. Wonderful! I had no idea how much this was interrupting my flow before it was fixed :) On 15 July 2016 at 19:34, Brad Fitzpatrick wrote: > > Done:

[go-nuts] Re: Strange results from append

2016-07-15 Thread Roberto Zanotto
I agree that the only thing that can make the two examples act differently should be the capacity of ns. The fact is that both versions are buggy, in the sense that one append can in general overwrite the other. If ns1 and ns2 are conceptually two different slices, it's better to ensure that

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Brad Fitzpatrick
On Fri, Jul 15, 2016 at 5:47 AM, Peter Waller wrote: > Awesome! > > For me it brings the CPU time from 6.5s to 3s. Wall from 2.9s to 2s. A > noticable improvement. > > One thing that still makes it slow for me (2s instead of 500ms, I just > tested), is that I have several of

[go-nuts] looking for the equivelant golang code in the aws s3 sdk, but have not found it yet. Anyone help here??? Thanks.

2016-07-15 Thread JM
I am trying to find the equivalent of getSignedURL and hoping i'm just blind and overlooking it somewhere. //Generates a short lives signed url to be used from the client to upload an image. function(req, res){ aws.config.update({accessKeyId: AWS_ACCESS_KEY , secretAccessKey:

[go-nuts] Re: Strange results from append

2016-07-15 Thread Evan Digby
Thanks Roberto. That certainly explains the second result, so it perhaps updates my "expected" result to be the second and not the first. Unfortunately it does not necessarily explain why the first result acts differently. I can reproduce what you describe in go playground, but not the

[go-nuts] Re: Strange results from append

2016-07-15 Thread Roberto Zanotto
https://golang.org/pkg/builtin/#append If the initial slice ns has enough capacity, it will not be reallocated, but only resliced and modified in place. So, in your second example, ns1 and ns2 can end up being two slices that share the same underlying array. On Friday, July 15, 2016 at 7:28:32

[go-nuts] Re: goimports has been updated

2016-07-15 Thread dglasser
On Thursday, July 14, 2016 at 10:34:36 PM UTC-7, bradfitz wrote: > > goimports has been updated. > > If you've been frustrated by its speed lately, run: > >$ go get -u golang.org/x/tools/cmd/goimports > > ... and things should be much nicer. > > Details at https://golang.org/cl/24941 > In

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

2016-07-15 Thread Mauro Toffanin
On 12/07/16 22:23, Henrik Johansson wrote: > I use gb. I like it a lot and I have had no issues. +1 Gb puts emphasis on reliable and reproducible builds; none of the other package managers have such feature, and none of them work so well as gb. -- You received this message because you are

Re: [go-nuts] I get a "Invalid cast. " error when debuging

2016-07-15 Thread Konstantin Khomoutov
On Fri, 15 Jul 2016 01:43:35 -0700 (PDT) 18126523...@163.com wrote: > I using gdb for debugging, and set a variable new value , then > failed. > > look this screen: > > (gdb) whatis tokenId > type = struct string > (gdb) set tokenId="ab" > Invalid cast. > (gdb) > > > GO in gdb is not

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Sam Whited
On Fri, Jul 15, 2016 at 9:49 AM, Peter Waller wrote: > Another suggestion which might be even nicer for the implementation: if a > directory contains `.goimportsignore`, that directory is skipped. That would have to be in addition to a file that lists directories, otherwise

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Zlatko Čalušić
On 15.07.2016 16:31, Jan Mercl wrote: On Fri, Jul 15, 2016 at 4:29 PM Thomas Frössman > wrote: > Yeah. I also have (several) linux trees, gcc's and stuff in my GOPATH.. I would really like some global config way to tell

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Thomas Frössman
Yeah. I also have (several) linux trees, gcc's and stuff in my GOPATH.. I would really like some global config way to tell goimports/gorename/... to ignore a bunch of subtrees. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Thomas Frössman
Yeah. I also have (several) linux trees, gcc's and stuff in my GOPATH.. I would really like some global config way to tell goimports/gorename/... to ignore a bunch of subtrees. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] What does -fm mean as a suffix for a runtime function name?

2016-07-15 Thread roger peppe
The semantic difference is that Type.Method takes the receiver as its first argument, whereas value.Method does not (the value is part of the closure context, which is why creating a function in this way incurs an allocation). On 15 Jul 2016 07:16, "Gregory Golberg" wrote: >

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Zlatko Čalušić
I'd like to second this! Also have the linux tree in $GOPATH, and ever since I put it there goimports slowed down. Some kind of subtree exclusion mechanism would be great. Nevertheless, thank you for your work on probably the most useful Go tool out there, Brad! I can't imagine programming

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
Awesome! For me it brings the CPU time from 6.5s to 3s. Wall from 2.9s to 2s. A noticable improvement. One thing that still makes it slow for me (2s instead of 500ms, I just tested), is that I have several of deep trees which aren't go code in my $GOPATH/src. To name a few: linux, clang, llvm.

[go-nuts] Re: goimports has been updated

2016-07-15 Thread Damian Gryski
Leaving blank lines in the imports section allows grouping: https://github.com/golang/go/wiki/CodeReviewComments#imports Damian -- 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,

Re: [go-nuts] Re: goimports has been updated

2016-07-15 Thread Matthew Singletary
Thanks Brad! -- 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

[go-nuts] I get a "Invalid cast. " error when debuging

2016-07-15 Thread 18126523585
I using gdb for debugging, and set a variable new value , then failed. look this screen: (gdb) whatis tokenId type = struct string (gdb) set tokenId="ab" Invalid cast. (gdb) GO in gdb is not supported a memory value change? -- You received this message because you are subscribed to the

Re: [go-nuts] Re: Is there a bug in path.Dir?

2016-07-15 Thread 18126523585
OK, i get it 在 2016年6月21日星期二 UTC+8上午9:46:09,Ian Lance Taylor写道: > > On Mon, Jun 20, 2016 at 5:59 PM, <18126...@163.com > wrote: > > Package "filepath" works well, but the "path" package is not recommended > ? > > The path package is for slash-separated packages such as appear in URLs. > >

Re: [go-nuts] Re: How to make the first character in a string lowercase?

2016-07-15 Thread Viktor Kojouharov
Did you test it with combined code points? On Thursday, July 14, 2016 at 11:18:20 PM UTC+3, John Souvestre wrote: > > What if the first character is a combined code point? > > > > John > > John Souvestre - New Orleans LA > > > > *From:* golan...@googlegroups.com [mailto: >

Re: [go-nuts] What does -fm mean as a suffix for a runtime function name?

2016-07-15 Thread Gregory Golberg
Ah, Jakob, thanks - did not see this before. What's the semantic difference though, I'm not getting it. On Wednesday, July 6, 2016 at 4:24:54 AM UTC-7, Jakob Borg wrote: > > 2016-07-06 7:10 GMT+02:00 Gregory Golberg >: > >> Not really: https://play.golang.org/p/1-31t3prci