Re: [go-nuts] filepath.Clean

2016-07-13 Thread brainman
I don't remember. I suspect I was only worried about making tests pass. And keep existing code as simple as I have found it. (Just as Ian explained) Alex On Thursday, 14 July 2016 06:41:53 UTC+10, Anmol Sethi wrote: > > I’ve cced him, hopefully he can state exactly why. > > > On Jul 13, 2016,

[go-nuts] Re: cockroachdb install with the homebrew option on Mac OS X El Capitan

2016-07-13 Thread Young Lee
My bad, Well, turns out that our company is using a thirdparty filtering service and apparently is blocking access to the url https://honnef.co/go/unused?go-get=1 , :( - Young On Saturday, April 2, 2016 at 6:55:14 PM UTC-7, Young Lee wrote: > > Hi, > > I saw the cockroachdb beta announcement

[go-nuts] Golang concurrency design question

2016-07-13 Thread nakuldesai88
I was going through the concurrent directory traversal program (similar to the unix du command) provided as an example in the "Go Programming Language" book (by Kernighan and Donovan). The example is on lines of the following (slightly modified to clarify the question): *// semaphore to

[go-nuts] Re: Reverse proxy with HTTP2 support

2016-07-13 Thread Tamás Gulácsi
caddyserver.com -- 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] Re: How to make the first character in a string lowercase?

2016-07-13 Thread Tamás Gulácsi
But this works only for ASCII input! -- 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

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

2016-07-13 Thread Nigel Tao
On Thu, Jul 14, 2016 at 12:35 AM, A Keeton wrote: > I'm trying to decompress messages arriving over websockets that are using > permessage-deflate. You say that you're using "per message" deflate... > Each new websockets message is written into buf and then I call Read on

Re: [go-nuts] Re: any way to save an image to 8-bit indexed png format?

2016-07-13 Thread Nigel Tao
On Thu, Jul 14, 2016 at 2:07 AM, wrote: > [haven't actually checked if the PNG package will work with this - but this > would be the way to go if supported] The PNG package should work with this: https://play.golang.org/p/Sxl-nLnecy -- You received this message because you

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

2016-07-13 Thread Sean Russell
Hi Nathan, On Wednesday, July 13, 2016 at 11:43:09 AM UTC-4, Nathan Fisher wrote: > Out of curiosity if the upstream deletes their repo does a force push > invalidating a sha or in some other way causes a dangling reference how do you > protect against that without checking the dependency in? I'm

[go-nuts] Trying to verify io.Copy and underlying way of handling files.

2016-07-13 Thread Eliezer Croitoru
I have looked at : https://github.com/rainycape/vfs and I am trying to understand and predict what to be expected from the VFS when I will be using io.Copy on a file. The VFS has a lock on a file but from what I have seen until now in the source code it locks the file on a "read' operation but

[go-nuts] Re: exec.Cmd: if the child forks Wait may hang forever

2016-07-13 Thread noxiouz
https://github.com/golang/go/blob/master/src/os/exec/exec.go#L484 set io.Writer explicitly so it looks like a bug среда, 13 июля 2016 г., 23:50:56 UTC+3 пользователь noxiouz написал: > > Good day! > > I faced a corner case of cmd.Exec usage and want to find out if it's > designed behavior. > >

Re: [go-nuts] exec.Cmd: if the child forks Wait may hang forever

2016-07-13 Thread Steven Hartland
If your forked process still has stdin / stdout open then I would say this is expected. You could confirm this by adding the following to the python script. import sys ... if pid == 0: sys.stdin.close() sys.stdout.close() On 13/07/2016 21:50, noxiouz wrote: Good day! I faced a corner

Re: [go-nuts] exec.Cmd: if the child forks Wait may hang forever

2016-07-13 Thread Ian Lance Taylor
On Wed, Jul 13, 2016 at 1:50 PM, noxiouz wrote: > > I faced a corner case of cmd.Exec usage and want to find out if it's > designed behavior. ... > So I would like to find out if setting cmd.Stdout explicitly is not > expected. Sounds like https://golang.org/issue/13155

Re: [go-nuts] filepath.Clean

2016-07-13 Thread Anmol Sethi
I’ve cced him, hopefully he can state exactly why. > On Jul 13, 2016, at 4:02 PM, Ian Lance Taylor wrote: > > On Wed, Jul 13, 2016 at 10:40 AM, Anmol Sethi wrote: >> Why does filepath.Clean replace each slash with a separator at the end of >> the function?

Re: [go-nuts] Initializing a channel as "Closed" so that it doesn't block if a "Thing" hasn't been done yet

2016-07-13 Thread Harmen B
I don't understand the problems 100%, but maybe these things can point you in the right direction: - try to see if using a sync.WaitGroup{} can help you. WaitGroups are great to use when you need to keep track of a varying bunch of Go routines. - you can send channels over channels, to wait for

Re: [go-nuts] filepath.Clean

2016-07-13 Thread Ian Lance Taylor
On Wed, Jul 13, 2016 at 10:40 AM, Anmol Sethi wrote: > Why does filepath.Clean replace each slash with a separator at the end of the > function? What’s the point of attempting to clean it if the separator used is > incorrect? Wouldn’t doing this at the start of the function

Re: [go-nuts] filepath.Join

2016-07-13 Thread Steven Hartland
Are the unexported methods OS specific? On 13/07/2016 20:56, Anmol Sethi wrote: Why does filepath.Join only call to the unexported join? Why not just export the unexported join? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Rel in path package

2016-07-13 Thread Anmol Sethi
Thanks Ian! > On Jul 13, 2016, at 10:23 AM, Ian Lance Taylor wrote: > > On Wed, Jul 13, 2016 at 2:43 AM, Anmol Sethi wrote: >> Right here: >> https://github.com/nsf/gocode/blob/f535dc686130fcc7b942c504ce5903222a205ca3/autocompletecontext.go#L254 >> >> I

Re: [go-nuts] Rel in path package

2016-07-13 Thread Anmol Sethi
fixed here: https://github.com/nsf/gocode/pull/361/files Not sure what I was thinking when I wrote that code. My bad. > On Jul 13, 2016, at 10:23 AM, Ian Lance Taylor wrote: > > On Wed, Jul 13, 2016 at 2:43 AM, Anmol Sethi wrote: >> Right here: >>

[go-nuts] filepath.Clean

2016-07-13 Thread Anmol Sethi
Why does filepath.Clean replace each slash with a separator at the end of the function? What’s the point of attempting to clean it if the separator used is incorrect? Wouldn’t doing this at the start of the function make more sense? -- You received this message because you are subscribed to

Re: [go-nuts] bodyless functions in standard libary

2016-07-13 Thread Aram Hăvărneanu
https://golang.org/doc/asm -- Aram Hăvărneanu -- 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

Re: [go-nuts] Re: Reverse proxy with HTTP2 support

2016-07-13 Thread Tim Hawkins
https://github.com/containous/traefik On 14 Jul 2016 2:13 a.m., "Kevin Klues" wrote: > Im curious about this as well. Are there any plans to build native support > for a reverse proxy that can directly forward HTTP/2 traffic to a backend > server? If not, does anyone know of a

[go-nuts] Re: Reverse proxy with HTTP2 support

2016-07-13 Thread Kevin Klues
Im curious about this as well. Are there any plans to build native support for a reverse proxy that can directly forward HTTP/2 traffic to a backend server? If not, does anyone know of a usable external project that provides this functionality? On Wednesday, March 30, 2016 at 2:48:11 AM UTC-7,

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

2016-07-13 Thread narenarya . 007
On Saturday, November 24, 2012 at 4:21:23 PM UTC+5:30, Nikolai wrote: > > Hi! > > What is the easiest way to make a string "LikeThis" --> "likeThis"? > Here is my answer bytestr := []byte(str) for index, character := range bytestr { char := string(character) if char ==

[go-nuts] Re: [ANN] Vermeer - physically based rendering (raytracing) with Go

2016-07-13 Thread Jamie Clarkson
Ah yes, thanks for that - it should be relatively easy to add back in the Go code to support all architectures (it was all originally Go before rewriting in ASM for the SIMD) so I'll add a note to do that soonish. The SSE4 requirement may be able to be relaxed too as the traversal code

Re: [go-nuts] bodyless functions in standard libary

2016-07-13 Thread xiiophen
Thanks - so I assume the exported function Frexp is a golang fallback if the relevant architecture assembly file isn't found (?) Is there any official (or unofficial) documentation on linking assembly from packages? -- You received this message because you are subscribed to the Google

[go-nuts] bodyless functions in standard libary

2016-07-13 Thread xiiophen
(newb question) Bodyless functions - such as https://golang.org/src/math/frexp.go?s=469:514#L6 found in the standard library are currently mystifying me.. There's an unexported function of the same name and signature on the same file but no call to it. Is this explained somewhere (I read the

[go-nuts] Re: any way to save an image to 8-bit indexed png format?

2016-07-13 Thread xiiophen
On Wednesday, 13 July 2016 03:32:55 UTC+1, sleepy wrote: > > I need to shrink images to as small as possible with an acceptable quality. > found https://tinypng.com/ could convert the image to 8-bit indexed png, > which is best fit my requirement. > > however, I need to do this by my go

[go-nuts] Re: Redis / Gin Framework Performance Issue

2016-07-13 Thread desaiabhijit
Unix sockets taken performance to 87 k req/sec redisClient = redis.NewClient({ Dialer: func() (net.Conn, error) { return net.DialTimeout("unix", "/tmp/redis.sock", 1*time.Second) }, Password: "", DB: 0, PoolSize: 10, }) Thanks,

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

2016-07-13 Thread catalasexx
what about https://play.golang.org/p/TbZ-fbhUCb ? the code don't create goroutine. thus you don't have to care about troubles with managing goroutine. 2016년 7월 13일 수요일 오전 6시 36분 15초 UTC+9, The MrU 님의 말: > > Hi, > > I have this code https://play.golang.org/p/9o5TReZ7jT3 >

Re: [go-nuts] Rel in path package

2016-07-13 Thread Ian Lance Taylor
On Wed, Jul 13, 2016 at 2:43 AM, Anmol Sethi wrote: > Right here: > https://github.com/nsf/gocode/blob/f535dc686130fcc7b942c504ce5903222a205ca3/autocompletecontext.go#L254 > > I have to annoyingly use filepath.ToSlash after just in case the user was on > windows. I don't know

Re: [go-nuts] How can I get running func name?

2016-07-13 Thread Jan Mercl
On Wed, Jul 13, 2016 at 3:56 PM Harry wrote: > I want to keep something records as log and where it is to specify. Many loggers are able to include the file_name:line_number info, which is cheaper to obtain at runtime. -- -j -- You received this message because you are

Re: [go-nuts] How can I get running func name?

2016-07-13 Thread Harry
I want to keep something records as log and where it is to specify. 2016年7月13日水曜日 21時28分52秒 UTC+9 Konstantin Khomoutov: > > On Wed, 13 Jul 2016 04:48:18 -0700 (PDT) > Harry wrote: > > > func SomethingFunc() { > > fmt.Printf("func is %s\n", funcName) > > /* code */ >

Re: [go-nuts] How can I get running func name?

2016-07-13 Thread Jan Mercl
On Wed, Jul 13, 2016 at 1:48 PM Harry wrote: > If I could get func name automatically, same code can be used. https://play.golang.org/p/XjDcnK78xY -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] How can I get running func name?

2016-07-13 Thread Harry
Hello, everyone. As title, I'm trying the below. func SomethingFunc() { fmt.Printf("func is %s\n", funcName) /* code */ } I want to show func name when running each func. If I could get func name automatically, same code can be used. Thank you. Harry. -- You received this message

Re: [go-nuts] Plurality of package naming

2016-07-13 Thread Nathan Fisher
struct and class semantics aren't equivalent but they are similar. Which is why I think the rule "avoid -er" is relevant. If you're struggling to name something then you probably don't know what it is and what it needs to do. I'm not advocating going to the Java extreme of fifty syllable names.