Re: [go-nuts] Fast ConcurrentCounter without memory sharing

2016-08-14 Thread Gaurav Agarwal
Ian, thanks for the explanation and the link ! But I am still unclear how to implement such a concurrent counter in Go - given that we can't find out what thread/cpu is the goroutine executing. Note that in this case there was never the need of pinning a goroutine to a thread or cpu; just that we

[go-nuts] runtime.Caller ->

2016-08-14 Thread 'Tim Hockin' via golang-nuts
I was playing with a method that wants to print the file:line of the caller. `runtime.Caller(1)` seems like it should do the trick, but I get ':2'. If I call `runtime.Caller(2)` instead it seems to work, but I don't know why, so I am reluctant to depend on that. Can anyone enlighten me? How

[go-nuts] Re: Wxwidgets , Best GUI package for Golang!

2016-08-14 Thread unxeds
https://github.com/dontpanic92/wxGo -- 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] runtime.Caller ->

2016-08-14 Thread Ian Lance Taylor
On Sun, Aug 14, 2016 at 11:10 AM, 'Tim Hockin' via golang-nuts wrote: > I was playing with a method that wants to print the file:line of the > caller. `runtime.Caller(1)` seems like it should do the trick, but I > get ':2'. If I call `runtime.Caller(2)` instead it

RE: [go-nuts] Fast ConcurrentCounter without memory sharing

2016-08-14 Thread John Souvestre
Hello Gaurav. You might want to look at Jon Gjengset's project: https://github.com/jonhoo/drwmutex Also, I seem to recall Dmitry saying that sync.Pool distributes locking. So it might be worth looking into. Another type of lock which might be of interest is MCS (or K42, CLH, HCLH). John

[go-nuts] Re: Cast interface{} to []string

2016-08-14 Thread 'simon place' via golang-nuts
could something like this help; https://play.golang.org/p/9tbiUY1w0d On Friday, 12 August 2016 19:41:26 UTC+1, Vasily Korytov wrote: > > Hi, > > I have an interface{} variable that can be either string or a list of > string (yes, that's bad design, I know). > > I need a []string to feed it to

[go-nuts] [ANN] gopkg.in/gcfg.v1 : gcfg v1.2.0 released

2016-08-14 Thread speter . go1
Gcfg reads "INI-style" text-based configuration files with "name=value" pairs grouped into sections (gcfg files). A lot has been happening to gcfg since my previous announcement. Most notably, the project has moved from Google Code: gopkg.in/gcfg.v1 https://godoc.org/gopkg.in/gcfg.v1

Re: [go-nuts] runtime.Caller ->

2016-08-14 Thread 'Tim Hockin' via golang-nuts
It is, in fact, a method on an embedded type. That means I can document it and it ceases to be a magic number! Thanks. On Aug 14, 2016 12:27 PM, "Ian Lance Taylor" wrote: > On Sun, Aug 14, 2016 at 11:10 AM, 'Tim Hockin' via golang-nuts > wrote:

Re: [go-nuts] runtime.Caller ->

2016-08-14 Thread 'Tim Hockin' via golang-nuts
Edit: It looks like this has more to do with being an interface method than an embedded type. https://play.golang.org/p/I5XPdWR_O0 Is there a generic way to get the caller safely, or should I just check for and increment? On Sun, Aug 14, 2016 at 3:02 PM, Tim Hockin wrote:

Re: [go-nuts] Who Loves Go?

2016-08-14 Thread Matt Harden
I love it! On Sun, Aug 14, 2016 at 7:01 PM Kevin Malachowski wrote: > I do! > > -- > 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] Fast ConcurrentCounter without memory sharing

2016-08-14 Thread Ian Lance Taylor
On Sun, Aug 14, 2016 at 2:49 PM, Nigel Tao wrote: > On Aug 15, 2016 05:21, "Ian Lance Taylor" wrote: >> If these approaches seem awkward, I suppose you could get >> syscall(syscall.GETCPU, ...) when you want to increment a counter. > > That still seems racy:

[go-nuts] Who Loves Go?

2016-08-14 Thread Dorival Pedroso
Hello Everyone, I'm preparing a list of people / companies that use Go and *really like Go*. The plan is to present this to a large crowd of undergraduate students (and others). So, suggestions are very welcome! Many thanks. Dorival -- You received this message because you are subscribed to

[go-nuts] Bug: gomobile on iOS 10 crashes after app is suspended+resumed

2016-08-14 Thread Steve
Hi all, I've found a reproducible crash of gomobile on iOS 10 using 1.7 rc6 (this isn't the time system call issue). I'm happy to submit a detailed bug report, but I wasn't sure if this issue already being tracked, and didn't want to duplicate another bug. Short description: a framework

[go-nuts] Bug: gomobile on iOS 10 crashes after app is suspended+resumed

2016-08-14 Thread Dave Cheney
Please file a bug. -- 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] runtime.Caller ->

2016-08-14 Thread 'Tim Hockin' via golang-nuts
On Sun, Aug 14, 2016 at 8:31 PM, Ian Lance Taylor wrote: > On Sun, Aug 14, 2016 at 3:33 PM, Tim Hockin wrote: >> Edit: It looks like this has more to do with being an interface >> method than an embedded type. >> >> https://play.golang.org/p/I5XPdWR_O0 > >

Re: [go-nuts] runtime.Caller ->

2016-08-14 Thread Dave Cheney
The autogenerated miranda method only happens if you are calling through an interface method that is provided by an embedded type. If you're doing something like func log(...) { pc := runtime.Callers(1) // get the caller of log } It shouldn't be a problem. On Monday, 15 August 2016

[go-nuts] Re: Wxwidgets , Best GUI package for Golang!

2016-08-15 Thread Peter Howard
This shows how to make a standalone gui program with Go that uses html5 and Bootstrap css, but with all the resources compiled into the Go executable. https://github.com/peterhoward42/godesktopgui -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Re: Closures vs structs with embedded functions (I call 'em pseudo-closures)

2016-08-12 Thread xiiophen
On Saturday, 13 August 2016 00:57:10 UTC+1, simon place wrote: > > aren't your "pseudo-closure"'s commonly know as "objects"? > > In languages that have "objects" (and not the structs I'm using here that serve the same function) the answer is yes. Of course this is already known eg

[go-nuts] Re: Closures vs structs with embedded functions (I call 'em pseudo-closures)

2016-08-12 Thread 'simon place' via golang-nuts
aren't your "pseudo-closure"'s commonly know as "objects"? -- 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

Re: [go-nuts] keyed vs unkeyed fields

2016-08-12 Thread Ian Lance Taylor
On Fri, Aug 12, 2016 at 2:29 PM, Anmol Sethi wrote: > Keyed fields seem to be always better than unkeyed fields in a composite > literal. > Under what circumstances would I want to use unkeyed fields? Keys aren't always useful, e.g., var colors = [...]string{"red", "blue",

Re: [go-nuts] keyed vs unkeyed fields

2016-08-12 Thread Anmol Sethi
My bad. I should have specified that I meant struct literals. > On Aug 12, 2016, at 6:02 PM, Ian Lance Taylor wrote: > > On Fri, Aug 12, 2016 at 2:29 PM, Anmol Sethi wrote: >> Keyed fields seem to be always better than unkeyed fields in a composite >>

[go-nuts] Re: Increase speed of repeated builds

2016-08-12 Thread Dave Cheney
Thank you for this information. There is no timing information. On Saturday, 13 August 2016 08:01:19 UTC+10, James Pettyjohn wrote: > > Here we go: > > WORK=/var/folders/j7/4pq3fms94f16lq7sljs3gd1cgp/T/go-build579975441 > site_www2 > mkdir -p $WORK/site_www2/_obj/ > mkdir -p

Re: [go-nuts] Cast interface{} to []string

2016-08-12 Thread Jesse McNelis
On Sat, Aug 13, 2016 at 4:41 AM, Vasily Korytov wrote: > Hi, > > I have an interface{} variable that can be either string or a list of string > (yes, that's bad design, I know). Your code below indicates that you're storing a []interface{} not an []string. > Have I

Re: [go-nuts] Need trailing comma before newline in composite literal

2016-08-12 Thread pgore
Because of this reason I started feeling it natural :D thanks Andrew Gerrand for pointing out. On Friday, November 18, 2011 at 9:47:18 AM UTC+5:30, Andrew Gerrand wrote: > > It's not just that. It also means that you can more easily re-order the > lines of a literal without needing to worry

[go-nuts] Out of "bandwidth": Selling gortos.com and related domains

2016-08-12 Thread Rasmus Ulslev Pedersen
Hello, I think the best place to find someone who can understand the potential in the idea in using go as the basis for an RTOS is this list. I do not have the time to pursue the idea of "*gortos.com"* that + the hardware that needs to go along with it (which I think is necessary to make

Re: [go-nuts] Invoking Golang executable on Mac OS X

2016-08-13 Thread Justin Israel
Maybe wrap it with Automator into an app? On Sat, 13 Aug 2016, 5:52 AM wrote: > Maybe this is more OS related than Go, since Go just produces a static > executable, so please feel free to lock this. > > I've built a simple tool, it works just fine in the terminal, both

Re: [go-nuts] keyed vs unkeyed fields

2016-08-13 Thread Anmol Sethi
Thing is, since keyed fields are almost always better, why were unkeyed fields even allowed for struct literals? I see what you mean in your example, but I think it would be simpler to only have unkeyed fields. Was it a mistake or is there a even better reason? > On Aug 12, 2016, at 10:12 PM,

Re: [go-nuts] what is the meaning of ENV GOEXE

2016-08-13 Thread Anmol Sethi
I looked in the Go source code. You can’t actually set it as a environment variable. It’s the value of the executable suffix. It’s set automatically in build.go. Like if running on windows, it is '.exe’ or for c-archives it is ‘.a’. I don’t think it matters for an end user. > On Aug 13, 2016,

[go-nuts] xDT encoder / decoder

2016-08-13 Thread Joe Blue
There is a full implementation in js, so there is a starting point. I can also provide test data of course. https://www.npmjs.com/package/xdt -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] context race

2016-08-13 Thread Dave Cheney
Receiving from a closed channel immediately returns the channel types zero value. -- 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] what is the meaning of ENV GOEXE

2016-08-13 Thread Andy Xie
​thanks. Just run `go env` and see it and is curious about it. === Ning Xie 2016-08-13 20:01 GMT+08:00 Anmol Sethi : > I looked in the Go source code. You can’t actually set it as a environment > variable. It’s the value of the executable suffix. It’s set automatically >

[go-nuts] context race

2016-08-13 Thread upadhyay
Say I have: func DoSomething(ctx context.Context) { for { select { case <- ctx.Done(): return case <- time.After(time.Second) // do something } } } Based on the documentation of context: Successive calls to Done return the

[go-nuts] what is the meaning of ENV GOEXE

2016-08-13 Thread andyxning
when run `go env`, i get the following output: ``` GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/andy/Github/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GO15VENDOREXPERIMENT="1" CC="clang"

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread Klaus Post
On Saturday, 13 August 2016 17:18:16 UTC+2, Paul wrote: > > From what I gather even Adobe uses [dcraw]. > I am pretty sure it is the other way around. Observing for years, it seems like dc is reverse engineering the Adobe DNG Converter. His color conversion matrices are definitely from that,

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread Klaus Post
On Wednesday, 27 July 2016 04:36:31 UTC+2, Jonathan Pittman wrote: > > Well me too! I am looking to see what level of interest there is in the > Go community to see this happen. I am also looking for people who are > interested in working on this. > (a bit late to the party) I am the author

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread Klaus Post
On Saturday, 13 August 2016 17:22:29 UTC+2, Peter Herth wrote: > > Having a parallel version of the raw converter could yield conversion > times far faster then the original C. And it would be a neat Go library to > have. > For the biggest part, I would not expect you to be able to beat C

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread 'Paul' via golang-nuts
I don't know what the true story actually is, however some camera hardware makers such as Nikon are giving software developers a tough time by intentionally obfuscating their metadata. A lot of folks had big problems with that including adobe. I just mentioned "reverse engineering" to indicate

Re: [go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread Peter Herth
Dcraw seems to be only partially gpl - otherwise Adobe couldn't use it in its products. Having a parallel version of the raw converter could yield conversion times far faster then the original C. And it would be a neat Go library to have. Peter On Sat, Aug 13, 2016 at 5:18 PM, 'Paul' via

Re: [go-nuts] Small complete examples which show the power of Go?

2016-08-13 Thread as . utf8
It's shorter, but it's harder for me to grasp what it does as easily as the first example. On Wednesday, August 10, 2016 at 2:09:58 AM UTC-7, Anmol Sethi wrote: > > You can shorten that by 6 lines > > package main > > import "net/http" > > func main() { > http.ListenAndServe(":8080",

Re: [go-nuts] keyed vs unkeyed fields

2016-08-13 Thread Ian Lance Taylor
On Sat, Aug 13, 2016 at 12:06 AM, Anmol Sethi wrote: > Thing is, since keyed fields are almost always better, why were unkeyed > fields even allowed for struct literals? I see what you mean in your example, > but I think it would be simpler to only have unkeyed fields. > > Was

[go-nuts] Re: golang.org/x/tools/go/loader: file names of parsed *ast.File

2016-08-13 Thread Paul Jolly
On Saturday, 13 August 2016 21:58:37 UTC+1, Paul Jolly wrote: > > Am I missing something obvious here? > Please excuse the reply to self, but I have discovered what I was missing. For the sake of completeness, here is how the equivalent mapping is achieved in golang.org/x/tools/go/loader world:

[go-nuts] Re: go mobile : keyboard input, camera

2016-08-13 Thread danilolr
About the camera I think you best hope is use NDK (c++ bindings to android functions). But you are out of luck as most of the links I search do not provide a solution. The best answer I find is this : http://stackoverflow.com/questions/30328276/access-android-camera-with-ndk Not tested, but I

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-13 Thread 'Paul' via golang-nuts
On Saturday, August 13, 2016 at 8:06:44 PM UTC+2, Klaus Post wrote: > > On Saturday, 13 August 2016 17:18:16 UTC+2, Paul wrote: >> >> From what I gather even Adobe uses [dcraw]. >> > > I am pretty sure it is the other way around. Observing for years, it seems > like dc is reverse engineering

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-10 Thread Jonathan Pittman
For some reason I did not get the last 3 updates until this one. Weird. So, I have looked over a number of packages that parse tiff files. While, at the most basic level, they all have to do the same sort of things, each one also approaches the situation a little differently. And more so,

[go-nuts] Looking for info on how Go package developers handle breaking changes with other packages

2016-08-10 Thread Chris Bogart
Hi, I'm looking for some help from developers who write Go packages. My research group is interested in the different choices new package managers and repositories are making when designing their ecosystems. Platforms like Node.js/NPM, Google's go, and Rust/Cargo are making somewhat different

[go-nuts] Looking for info on how Go package developers handle breaking changes with other packages

2016-08-11 Thread 'Ingo Oeser' via golang-nuts
Please note that there is no concept central repository of Go code. Those questions in the survey are very confusing for a Go developer. Maybe you could exclude those questions for Go developers. Otherwise you would need to ignore the results for Go developers here in your later analysis. --

[go-nuts] Re: Looking for info on how Go package developers handle breaking changes with other packages

2016-08-11 Thread Volker Dobler
I tried to fill out the survey but I got lost as I'm unsure what "go (community packages)" really means. Some question indicate that this could be the standard library, some questions make sense if you interpret "go (community packages)" as the golang.org/x/... packages while other questions seem

Re: [go-nuts] convert a given time in one Timezone to other TimeZone

2016-08-11 Thread laxman . ece
Apologize if my question was confusing. My question was to get the equivalent time to a given time in other time zones. Thanks Axel. Your code snippet helped in what i was solving to an extent. On Wednesday, August 10, 2016 at 10:54:50 PM UTC+5:30, Axel Wagner wrote: > >

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-08-12 Thread Evan Digby
Sorry, I didn't see your longer high-level overview post--I see the vision a bit more clearly now. Have you used slack? It might be a good place to start discussion to hammer out some details before moving onto a google doc. I find shared google docs can be challenging without at least a

[go-nuts] Cast interface{} to []string

2016-08-12 Thread Vasily Korytov
Hi, I have an interface{} variable that can be either string or a list of string (yes, that's bad design, I know). I need a []string to feed it to strings.Join (I need one string for output). This way works, that is explicitly creating []string and copying each element to it: var list

[go-nuts] go mobile : keyboard input, camera

2016-08-11 Thread zzzgeom
Hi, I have looked the go mobile docs / examples (the most advanced being 'flappy gopher'), but I can not find code/API for either of the following: 1) accessing the camera (i.e. taking a picture) 2) keyboard input (is the current best to draw a bunch of squares with letters in them in

[go-nuts] Cast interface{} to []string

2016-08-12 Thread Val
Looks fine to me. You'll have to iterate anyway. You can save a little perf by allocating directly the right size for your temp slice, with make. Then use indexing instead of append. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Looking for info on how Go package developers handle breaking changes with other packages

2016-08-12 Thread Chris Bogart
Thank you both -- yes, I see the problem. It was tricky to get the questions right to apply across ecosystems with different infrastructure and terminology; but we're particularly interested in comparing ecosystems like Go and (much of) Swift that don't have central repositories with ones

[go-nuts] Have some troubles with connection of delve + Visual Studio Code under my Mac

2016-08-12 Thread Dmitriy Suhinin
I can't run debug mode under Visual Studio Code. Everything seems configure well, but no answer from the delve. I can run Debug and I can see that delve process ruined, but no activity under Visual Studio Code. Can someone help with that? -- You received this message because you are

[go-nuts] Re: Go 1.7 Release Candidate 6 is released

2016-08-11 Thread foo bar
Hi David, The issue you are having seems related to https://github.com/golang/go/issues/16636 I'm also running Arch Linux, and it seems like -fsanitize=memory is broken on general for Clang on Arch. Would you be able to verify if this is also the case for you? Add a comment to the issue,

[go-nuts] keyed vs unkeyed fields

2016-08-12 Thread Anmol Sethi
Keyed fields seem to be always better than unkeyed fields in a composite literal. Under what circumstances would I want to use unkeyed fields? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Small complete examples which show the power of Go?

2016-08-10 Thread gary . willoughby
Hi, I'm giving a talk at work introducing Go and I'm looking for small examples to show Go's potential. For example, the following program demonstrates a bare-bones webserver in 13 lines: import ( "fmt" "net/http" ) func home(w http.ResponseWriter, r *http.Request) {

Re: [go-nuts] Small complete examples which show the power of Go?

2016-08-10 Thread Anmol Sethi
You can shorten that by 6 lines package main import "net/http" func main() { http.ListenAndServe(":8080", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello World!")) })) } A bare bones web server in just 9 lines! > On Aug

[go-nuts] http2 questions

2016-08-10 Thread Jeffrey Smith
I have been playing around with http2 in the latetst 1.7RC today and had a few questions I still had to import "golang.org/x/net/http2" and then set http2.ConfigureTransport to actually use http2 when creating a client. I was under the impression this was fixed or was I wrong?

[go-nuts] compressing long list of short strings

2016-08-10 Thread Alex Flint
I have long list of short strings that I want to compress, but I want to be able to decompress an arbitrary string in the list at any time without decompressing the entire list. I know the list ahead of time and it doesn't matter how much preprocessing time is involved. It is also fine if there

Re: [go-nuts] compressing long list of short strings

2016-08-10 Thread Ian Lance Taylor
On Wed, Aug 10, 2016 at 3:27 PM, Alex Flint wrote: > > I have long list of short strings that I want to compress, but I want to be > able to decompress an arbitrary string in the list at any time without > decompressing the entire list. > > I know the list ahead of time and

[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-08-10 Thread matic
GitHub page says "Automatic encoding of special characters". Does that mean if I use output from (user provided input to a golang.org/pkg/text/template) as body input to gomail, gomail will properly escape any characters that could be used to insert SMTP headers or do anything else that could

[go-nuts] Re: Small complete examples which show the power of Go?

2016-08-10 Thread Val
Iterations over slices, maps, channels are very cool, usually straight to the point : func main() { for _, a := range []int{6, 4} { for _, b := range []int{2, 3} { for fname, f := range map[string]func(int, int) int{ "plus": func(x, y int) int { return x

[go-nuts] Re: Small complete examples which show the power of Go?

2016-08-10 Thread sphilippov
Easy parallelization and concurrency: package main import ( "runtime" ) func FoldParallel(data []float64, initialValue float64, op func(float64, float64) float64) float64 { sliceSize := len(data) / runtime.NumCPU() results := make(chan float64, runtime.NumCPU()) numResults

Re: [go-nuts] compressing long list of short strings

2016-08-10 Thread Alex Flint
There are around 2M strings, and their total size is ~6 GB, so an average of 3k each. I actually looked briefly at Go's compress/flate to see whether something like what you're describing is possible without writing my own compressor but I couldn't see any obvious way to get at the underlying

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

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

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

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

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: Go 1.7 Release Candidate 1 is released

2016-07-12 Thread Sathish VJ
On Mac, bash prompt, attempting to install go to custom location using package installation file go1.7rc1.darwin-amd64.pkg. But it is always installed in /usr/local/bin. export GOROOT="/Users/username/coding/golang/go1.7.rc1" export GOPATH="/Users/username/coding/golang/gopath" export

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

2016-07-12 Thread sleepy
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 program, any hints for this? thanks in advance. -- You received this

[go-nuts] if something not perfect here

2016-07-12 Thread wweir9
These are two screeshot from os/exec , it looks like that code below will always be true. len(c.Args) > 0

[go-nuts] Proposal: Add coloured output to go commands

2016-07-12 Thread Zac Pullar-Strecker
Commands like go run, go build and go test amoung others should have coloured output when an error occurs. it would make reading stack traces a lot easier. I personally use the go run tool a lot during development because I have no reason to keep a binary in the $GOPATH/bin directory when it's

Re: [go-nuts] http.Handler method name

2016-07-12 Thread Nigel Tao
On Wed, Jul 13, 2016 at 6:14 AM, Anmol Sethi wrote: > If you were to redesign it now, would you name the method Handle? Also speaking personally, yes. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Rel in path package

2016-07-12 Thread Ian Lance Taylor
On Tue, Jul 12, 2016 at 5:17 PM, Anmol Sethi wrote: > Why is there no function in the path package to get relative paths, like > filepath.Rel? When would you want to use it? Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts"

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

2016-07-12 Thread Matt Silverlock
gvt - simple but robust: https://github.com/FiloSottile/gvt -- 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] 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

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

Re: [go-nuts] How to make bootstrap style reflect on golang template

2016-07-12 Thread Josh Kamau
If you inspect the browser console, are you serving the bootstrap css ?? I normally do something like this: mux.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("./assets" And then my css link will be /assets/bootstrap/css/bootstrap.min.css where 'assets' is my

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

2016-07-12 Thread paraiso . marc
Nice Ctrl+P to navigate between files work well , it's like to be able to navigate between Symbols too. With a drop down menu . Le mardi 12 juillet 2016 09:09:15 UTC+2, visualfc a écrit : > > Hi, all > > LiteIDE x30.2 released, This version bug fix and build test for Go1.7 rc1 > > > ###

[go-nuts] ARM big-endian support roadmap

2016-07-12 Thread Igor Gatis
AFAIK, big endian support for ARM is not available. Will it ever be supported? Out of curiosity, how hard is this task? -- 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

[go-nuts] net/http: request canceled while waiting for connection

2016-07-12 Thread DM
Hi We making some http PUT calls to a web server using net/http. Some time in the log we are seeing the below errors:- {"level":"error","message":"Put http://blitz:2196/cache/api/v1/buckets/styloko/entities/product-xlarge-multi-sku-de898wa73oooindfas : *read tcp **172.16.84.112:2196*

Re: [go-nuts] ARM big-endian support roadmap

2016-07-12 Thread Ian Lance Taylor
On Tue, Jul 12, 2016 at 5:20 AM, Igor Gatis wrote: > > AFAIK, big endian support for ARM is not available. Will it ever be > supported? If somebody works on it, and can provide a build machine for testing. See https://github.com/golang/go/wiki/PortingPolicy . > Out of

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-12 Thread Ian Lance Taylor
On Tue, Jul 12, 2016 at 1:05 AM, wrote: > GCC slow, not GC. Sorry, my apologies for misreading. Ian > вторник, 12 июля 2016 г., 1:52:01 UTC+3 пользователь Ian Lance Taylor > написал: >> >> On Mon, Jul 11, 2016 at 1:25 PM, wrote: >> > Ohh that

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

2016-07-12 Thread Matt Silverlock
Sure, and that's why gorilla/mux uses context.Context internally. gorilla/sessions (and mux) both existed well before context.Context did, and sessions can't be changed without breaking the public API. On Tuesday, July 12, 2016 at 4:20:59 AM UTC-7, parais...@gmail.com wrote: > > Don't you

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

2016-07-12 Thread paraiso . marc
Don't you think it would be better to use context to hold session values rather than using global variables like github.com/gorilla/sessions does ? Le lundi 11 juillet 2016 00:43:05 UTC+2, Matt Silverlock a écrit : > > Use it to pass connection/request-scoped values: that is, values that >

Re: [go-nuts] Proposal: Add coloured output to go commands

2016-07-12 Thread Dan Kortschak
github.com/maruel/panicparse is a good package to do this if you need it. On Tue, 2016-07-12 at 22:26 -0700, Ian Lance Taylor wrote: > On Tue, Jul 12, 2016 at 9:36 PM, Zac Pullar-Strecker wrote: > > Commands like go run, go build and go test amoung others should have > >

Re: [go-nuts] Proposal: Add coloured output to go commands

2016-07-12 Thread Ian Lance Taylor
On Tue, Jul 12, 2016 at 9:36 PM, Zac Pullar-Strecker wrote: > Commands like go run, go build and go test amoung others should have > coloured output when an error occurs. it would make reading stack traces a > lot easier. I personally use the go run tool a lot during development

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

2016-07-12 Thread Ian Lance Taylor
On Tue, Jul 12, 2016 at 8:07 PM, wweir9 wrote: > These are two screeshot from os/exec , it looks like that code below will > always be true. > len(c.Args) > 0 > > > >

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.

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] 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] 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?

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

[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

<    3   4   5   6   7   8   9   10   11   12   >