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: > golan...@google

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

2016-07-15 Thread John Souvestre
Yes, I initially started the string with “A\u0312a”. The combining code point appears over the second “a” rather than the first. Hence my question. But after thinking about it and doing some additional testing, this appears to be a problem with my setup (Chrome on Windows 7). For example,

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. > > The

[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 Goog

[go-nuts] Re: goimports has been updated

2016-07-15 Thread Sathish VJ
hey brad, is it possible to have a ```goimports version``` so that we know what versions we currently have? On Friday, 15 July 2016 11:04:36 UTC+5:30, bradfitz wrote: > > goimports has been updated. > > If you've been frustrated by its speed lately, run: > >$ go get -u golang.org/x/tools/cmd/

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

2016-07-15 Thread Nazri Ramliy
On Fri, Jul 15, 2016 at 5:50 AM, Sam Vilain wrote: > Overall, go's clean vendoring and general 'import' approach leads to git > submodules being a perfect fit. Everything else is now legacy. I couldn't agree more to this. Been using git submodule for a few years, I did try giving other tools a t

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Ian Davis
On Fri, Jul 15, 2016, at 06:34 AM, Brad Fitzpatrick 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 Some really ne

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

2016-07-15 Thread mhhcbon
I use *glide *, it just works, it s per project vendor and it just works, and oh yeah, it uses a regular go project setup, also i don t have to maintain a global namespace across several separated projects. IMHO, the right way to go. Le mardi 12 juillet 2016 22:15:29 UTC+2

[go-nuts] Re: goimports has been updated

2016-07-15 Thread Darren Hoo
goimports won't remove empty lines. is that a feature? goimports on this: import ( "bufio" "fmt" "math" "strconv" "time" "math/rand" "os" ) will not become import ( "bufio" "fmt" "math" "math/rand" "os" "strconv" "time" ) On Friday, July 15, 2016 at 1:34:36 PM UTC+8, bradfitz wrote: > > goi

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 https://groups.google.com/d/optout.

[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, s

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. I

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 i

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: > Ah, Jakob, thanks -

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 fr

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 fr

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Jan Mercl
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 goimports/gorename/... to ignore a bunch of subtrees. I do not use goimports. My 2c anyway: What about checking for

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
On 15 July 2016 at 15:31, Jan Mercl <0xj...@gmail.com> wrote: > I do not use goimports. My 2c anyway: What about checking for > .goimportsignore in the root of the subtree that should be skipped? > +1. I was going to suggest this but before seeing support for the idea thought it sounded too unsav

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 goimports/gorename/... to ignore a bunch of

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 you can't skip submodu

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Peter Waller
On 15 July 2016 at 16:35, Sam Whited wrote: > 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 t

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Thomas Frössman
Environment variables like (maybe) GOIMPORTSIGNORE/GORENAMEIGNORE fits better with how go tools are currently configured than config files. On Fri, Jul 15, 2016 at 5:38 PM, Peter Waller wrote: > On 15 July 2016 at 16:35, Sam Whited wrote: > >> On Fri, Jul 15, 2016 at 9:49 AM, Peter Waller >> w

[go-nuts] [ANN] Buford v0.11.0 for Apple Push Notifications

2016-07-15 Thread Nathan Youngman
Buford is a Go library for sending remote notifications to iOS, macOS, tvOS, and watchOS. It uses the HTTP/2 protocol that Apple has supported since last year. Thanks to improvements in the x/net/http2 package, Buford is now able to correctly parse responses from Apple when their servers hang u

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Nathan Youngman
Thanks Brad. I also use $GOPATH ($HOME/src) for code non-Go projects. I'd be in favour of a more automated solution to ignoring folders that don't contain any *.go files (until such time as they start using *.go). Nathan. On Friday, 15 July 2016 06:48:12 UTC-6, Peter Waller wrote: > > Awesome

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Brad Fitzpatrick
On Fri, Jul 15, 2016 at 9:19 AM, Nathan Youngman wrote: > Thanks Brad. > > I also use $GOPATH ($HOME/src) for code non-Go projects. > > I'd be in favour of a more automated solution to ignoring folders that > don't contain any *.go files (until such time as they start using *.go). > It already d

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 support

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

2016-07-15 Thread 'Paul Borman' via golang-nuts
BTW, the solution I provided does change one digit at a time, working just like an odometer. The OP privately said that even the reporting channel was undesired in my solution, so I sent the OP a link to one that allocated a slice and then filled it in, rather than sending it down a channel. The

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

2016-07-15 Thread Bakul Shah
Ah. Should've read your original play link more carefully! You could've made it a bit more efficient by allocating one large string (N^N+N) and one Printf! Of course, that'd fall apart once you have more combinations than can fit in memory but that is easily solved. Still interested in knowing if

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

2016-07-15 Thread 'Paul Borman' via golang-nuts
It wasn't clear to me what the OP wanted. Did they just want to print them? Did they want to use them? For use, I think the channel is probably the most straightforward to use, but the OP didn't want any channels at all. The underlying array that slices refer to could also be made smaller, for

[go-nuts] Strange results from append

2016-07-15 Thread Evan Digby
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...), } Act differently than: ns1 := append(ns, g2message.NamespaceWin...) ns2 := append(ns, g2

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 subsc

[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 addi

[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: 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 varyi

[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: AWS_SECRET_KE

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 deep trees which aren

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

2016-07-15 Thread DM
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 models.SalesOrderItemAttribute: "*models.SalesOrderItemAttribute" != "order-

[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 the

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: https://go-review.googlesource.com/24971 > --

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 implement

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Brad Fitzpatrick
I am just as relieved. Imagine the pain and frustration you felt on every slow save but with an additional feeling of guilt that it's probably your fault and you should fix it, and other people use this thing nowadays. :) On Fri, Jul 15, 2016 at 12:56 PM, Peter Waller wrote: > Just saw this w

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 guilt that it's probably

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 models.SalesOrderItemAttribu

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

2016-07-15 Thread Thorsten von Eicken
I was surprised to see Printf %v panic on a struct that %#v prints fine. Is this expected / intentional / as designed? Test case: package main import ( "fmt" ) type MyError struct{ error } func main() { err := MyError{} fmt.Printf("%%#v %#v\n", err) fmt.Printf("%%+v %+v\n", err) fmt.Printf("%%

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

2016-07-15 Thread Matt Harden
I think MyError has the Error method, which %v will use but %#v will not. Then it panics because it's trying to call error(nil).Error(). On Fri, Jul 15, 2016, 13:22 Thorsten von Eicken wrote: > I was surprised to see Printf %v panic on a struct that %#v prints fine. > Is this expected / intentio

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

2016-07-15 Thread Thorsten von Eicken
You're probably correct, see this: package main import ( "fmt" ) type MyError struct{ error } type MyError2 struct { foo int err error } func main() { err := MyError{} fmt.Printf("%%#v %#v\n", err) fmt.Printf("%%+v %+v\n", err) fmt.Printf("%%v %v\n", err) err2 := MyError2{} fmt.Printf("%%#v %#

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 int > err error > } >

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 golang-nuts+unsubscr...@googlegroups.

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 > > im

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] 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 else? Then, why re

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 from this group and sto

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 tree? That seems mu

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 delve, which is at https://github.

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 G

[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* po

[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 worth

[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 imposs

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

2016-07-15 Thread Ian Lance Taylor
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 "exploitable" means more than just denial-of-service? I > am looking for qualitative estimates here. I

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, 2016

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 of the > closure cont

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

2016-07-15 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 unsubs