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

2016-07-14 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 ? >>

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

2016-07-14 Thread Bakul Shah
What the OP wants is equivalent to generating *all* n digit numbers in base n. For example, given aa ab ba bb if you map a to 0 and b to 1 you get numbers 0..3 (base 2). In general you have n^n combinations.. If you consider only the cost of *copying* (or changing an existing string to a diff

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

2016-07-14 Thread sleepy
Thanks, I will try it. 在 2016年7月14日星期四 UTC+8上午10:54:40,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:/

[go-nuts] Re: goimports has been updated

2016-07-14 Thread Tyler Compton
As helpful a tool as goimports is, I've really felt it slogging as of late, as well. It's great to hear that this has been given attention! 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-nuts] goimports has been updated

2016-07-14 Thread Brad Fitzpatrick
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 If I broke something, file a bug: https://golang.org/issues/new The general speed trackin

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

2016-07-14 Thread Nigel Tao
On Fri, Jul 15, 2016 at 9:14 AM, Adam Keeton wrote: > A small self-contained example with this code would be tricky with all of > the websocket handling stuff in the way. You could possibly capture the bytes of each compressed message, and then construct a new websocket-free program that starts w

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

2016-07-14 Thread Adam Keeton
> but then it sounds like you're concatenating all of the messages together, I should have mentioned that I reset the websockets buffer after reading from the deflater. A small self-contained example with this code would be tricky with all of the websocket handling stuff in the way. Regardless,

Re: [go-nuts] is there any plan to reduce native call overhead in go?

2016-07-14 Thread Rob Pike
By "native" do you mean C? Normally when programming in Go, native means in Go, not some other language, and this threw me. There is nothing "native", at least in my understanding of the term, about cgo. On the contrary, it is a mechanism for interacting with a foreign world. That's why the class

Re: [go-nuts] Why dose reflect.Value.InterfaceData() return [2]uintptr, not (uintptr, uintptr)?

2016-07-14 Thread Rob Pike
But not by accident. The thing it's returning is a two-word array even before it's returned and will be one after it's returned and after it's stored. In short, it's just not two values, it really is one two-word value. -rob On Thu, Jul 14, 2016 at 8:47 AM, Ian Lance Taylor wrote: > On Thu, J

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

2016-07-14 Thread Sam Vilain
On 7/12/16 1:15 PM, Johann Höchtl wrote: > I use godep. There has been lots of rumour lately to use gb. > > What do others use? > > If there is a blog post available somewhere comparing the pros and > cons, please provide one. > I know https://github.com/golang/go/wiki/PackageManagementTools > > I

[go-nuts] Re: linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
It's not codegen, it's pprof's listing. Sorry for the false alarm. -- 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 m

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

2016-07-14 Thread Dave Cheney
io.Copy doesn't know anything about files, it works with any type that implements io.Reader and io.Writer. -- 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 golan

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

2016-07-14 Thread John Souvestre
What if the first character is a combined code point? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Viktor Kojouharov Sent: 2016 July 14, Thu 03:57 To: golang-nuts Subject: [go-nuts] Re: How to make the first

[go-nuts] Re: linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
upd: windows/amd64 built from master-4054769 (latest atm), same -- 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

[go-nuts] linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
go version: go1.7rc1 linux/amd64 (from go1.7rc1.linux-amd64.tar.gz ) program: https://play.golang.org/p/pUyOao-V9w pprof weblist fragment: runtime.(*mspan).sweep /usr/local/go/src/runtime/mgcsweep.go Total:10ms 110ms

[go-nuts] problem executing two command and second command

2016-07-14 Thread Walter Garcia
Hello. I have problems running 2 commands. When the second COMMAND2 fail this return os.Exit(2) but my program never finish. If I see the process using ps ax I can see COMMAND2 If I run this 2 programs in linux command line, this work fine, but doesnt work in go. Could you help me? please Th

Re: [go-nuts] Re: New Context method in http.Request, what can we do with it?

2016-07-14 Thread Sameer Ajmani
Unless you need to pass the Request, pass its Context. This eases the composition of functions across packages that all take Context parameters. On Thu, Jul 14, 2016 at 3:09 PM Tyler Compton wrote: > Thanks for the responses. I've used contexts before and understand that > they do a great job of

[go-nuts] Re: New Context method in http.Request, what can we do with it?

2016-07-14 Thread Tyler Compton
Thanks for the responses. I've used contexts before and understand that they do a great job of moving request-scoped values around. What I meant to ask about is how having contexts be embedded in request objects would help in this process. Right now, my workflow and most everyone else's to my u

Re: [go-nuts] is there any plan to reduce native call overhead in go?

2016-07-14 Thread Caleb Spare
Reduce: yes, remove: not that I'm aware of. https://github.com/golang/go/issues/9704 https://github.com/golang/go/issues/16051 Much of the overhead is due to defer -- cgo calls have multiple defers. https://github.com/golang/go/issues/14939 https://github.com/golang/go/issues/6980 -Caleb On Th

[go-nuts] is there any plan to reduce native call overhead in go?

2016-07-14 Thread Nick Evgeniev
Hi, Is there any plan to reduce (remove) significant overhead for native calls in GO? With recent advances in minimizing gc pauses go becomes more attractive for low latency things... but hundreds nanoseconds overhead imposed on every C call makes it pointless :( -- You received this message

Re: [go-nuts] Why dose reflect.Value.InterfaceData() return [2]uintptr, not (uintptr, uintptr)?

2016-07-14 Thread Ian Lance Taylor
On Thu, Jul 14, 2016 at 7:05 AM, wrote: > http://research.swtch.com/interfaces > > is nice for reflect.Value.InterfaceData() to use (uintptr, uintptr)? > > Why doesn't it use two-value return? I think it's because when Rob added it in 2010 (https://golang.org/cl/2597041) he was working on the go

Re: [go-nuts] liteide x30.2 released

2016-07-14 Thread griffinish
I just started using liteide 2 weeks ago. It's great except for not addressing english-based support donations. On Tuesday, July 12, 2016 at 3:09:15 AM UTC-4, visualfc wrote: > > Hi, all > > LiteIDE x30.2 released, This version bug fix and build test for Go1.7 rc1 > > > ### 2016.7.12 Ver X30.2 >

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

2016-07-14 Thread farshid . tavakoli
I managed to do this by creating a custom io.Writer, adding prefix after the timestamp. Here is the code: https://gist.github.com/farshidtz/a64cb850e0a0c544823628ca4bc0e995 On Tuesday, June 17, 2014 at 11:24:21 PM UTC+2, Jacek Masiulaniec wrote: > > Hi Nuts, > > The below code: > > log.SetPref

[go-nuts] Re: TCP Server

2016-07-14 Thread EdgarAlejandro Vintimilla
Thanks, basically is a GPS that sends data to the server. It's for a fit traker. What is the best way to put into producción this server? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Why dose reflect.Value.InterfaceData() return [2]uintptr, not (uintptr, uintptr)?

2016-07-14 Thread catalasexx
http://research.swtch.com/interfaces is nice for reflect.Value.InterfaceData() to use (uintptr, uintptr)? Why doesn't it use two-value return? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving ema

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

2016-07-14 Thread roger peppe
Most of the Canonical Go projects use github.com/rogpeppe/godeps. It just dependency-locks; it doesn't vendor at all (although it doesn't preclude it). It's a no-fuss tool and pretty stable. Good for locking library dependencies. On 12 July 2016 at 21:15, Johann Höchtl wrote: > I use godep. The

[go-nuts] Re: if something not perfect here

2016-07-14 Thread wweir9
It is my thoughtless, thx a lot. 在 2016年7月13日星期三 UTC+8下午1:07:16,wweir9写道: > > These are two screeshot from os/exec , it looks like that code below will > always be true. > len(c.Args) > 0 > > > >

Re: [go-nuts] Golang concurrency design question

2016-07-14 Thread Jason Woods
> On 14 Jul 2016, at 05:56, nakuldesa...@gmail.com > wrote: > > // semaphore to control the number of open file descriptors > var sem = make(chan struct{}, 20) > > func dirents(dirName string) []os.FileInfo { >defer func() { ><-sem >}() > >//

Re: [go-nuts] Re: Golang concurrency design question

2016-07-14 Thread Dan Kortschak
Contexts grow. Yes, that was the OP's context. net is broader and so my comment needed qualification. :) On Thu, 2016-07-14 at 00:27 -0700, sphilip...@gmail.com wrote: > The exact context here is "concurrent directory traversal program" :) > > четверг, 14 июля 2016 г., 9:07:32 UTC+3 пользова

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

2016-07-14 Thread Christoph Berger
I cannot answer your question; I just wanted to mention that homebrew creates symlinks in /usr/local/bin when installing Go. So if you are just looking for an installer that does not extend $PATH, you might want to give homebrew a try. On Tuesday, July 12, 2016 at 10:05:36 PM

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

2016-07-14 Thread Viktor Kojouharov
https://play.golang.org/p/miLAFSDjrS For unicode On Thursday, July 14, 2016 at 7:26:13 AM UTC+3, Tamás Gulácsi wrote: > > 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 st

[go-nuts] How to statically linking library in GO

2016-07-14 Thread kumargv
This is the Link of program what i am compiling https://play.golang.org/p/drJGhsWiEi when i am using- go build program.go ,it generating ->program(binary) file ./program program: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.

Re: [go-nuts] Re: Golang concurrency design question

2016-07-14 Thread sphilippov
The exact context here is "concurrent directory traversal program" :) четверг, 14 июля 2016 г., 9:07:32 UTC+3 пользователь kortschak написал: > > Mostly. As always, the exact context is significant. > > On Thu, 2016-07-14 at 15:34 +0930, Dan Kortschak wrote: > > Yes. This is how it's done in the

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

2016-07-14 Thread Piyush Dewnani
The project indeed does look interesting, however it seems like it depends on MailGun proxy https://github.com/vulcand/oxy I might be missing something here, but it seems atleast in Vulcand forward module the support for a HTTP2 backend is not present. https://github.com/vulcand/oxy/blob/master/f

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

2016-07-14 Thread Piyush Dewnani
I might be wrong here, but looking at the current code it seems that the HTTP version gets kind of hard-coded https://github.com/mholt/caddy/blob/master/caddyhttp/proxy/reverseproxy.go#L166 On Thursday, July 14, 2016 at 9:57:37 AM UTC+5:30, Tamás Gulácsi wrote: > > caddyserver.com -- You recei