Re: [go-nuts] How do you create and use shared libraries in Go?

2017-06-26 Thread st ov
Is it possible to share package through *.a files? https://stackoverflow.com/questions/15551293/what-are-a-files-in-go Also saw this running 'go help buildmode' -buildmode=default Listed main packages are built into executables and listed non-main packages are built into .a files (the default

Re: [go-nuts] Goroutine error when running on load test.

2017-06-26 Thread Dave Cheney
Your stacktrace is truncated; the crucial part appears at the top of the output starting with panic: or runtime error: On Tuesday, 27 June 2017 14:31:57 UTC+10, Nupur Bansal wrote: > > When a load test is run on my service, after about 1000-1500 requests, I > get this stack trace. I am unab

Re: [go-nuts] Goroutine error when running on load test.

2017-06-26 Thread Nupur Bansal
When a load test is run on my service, after about 1000-1500 requests, I get this stack trace. I am unable to resolve why it was generated. Yes, the output from the service is passed to an output channel and is read through that channel. I am doing something like this: package main import (

Re: [go-nuts] How to be simple the code without select expression " x= A ? B: C "

2017-06-26 Thread Ian Lance Taylor
On Mon, Jun 26, 2017 at 8:50 PM, Wang Sheng wrote: > I am new for golang, I think following code is too redundant , is there any > way simplify it ? > > name, ok := fieldsMap["name"] > if !ok { >

[go-nuts] How to be simple the code without select expression " x= A ? B: C "

2017-06-26 Thread Wang Sheng
I am new for golang, I think following code is too redundant , is there any way simplify it ? name, ok := fieldsMap["name"] if !ok { name = ""

[go-nuts] Re: Canonical http upload code

2017-06-26 Thread Dave Cheney
Update, after running this program several times the 112mb/sec number is limited by how quickly the file could be streamed off disk. Once the source file was cached, the time to upload 7.4 gb dropped to around 3 seconds, so ~ 2.5 gb / sec, which is more reasonable for the loopback. What do you

[go-nuts] Re: Canonical http upload code

2017-06-26 Thread Dave Cheney
Hi Kai, I had a quick play with this simple server https://play.golang.org/p/LFx0HmXK4q This simple server took 67 seconds to upload a 7.4gb file over the loopback interface, which is around 112 mb per second, which is faster than what you are seeing, but not that fast either, given it's on th

[go-nuts] Canonical http upload code

2017-06-26 Thread Kai Hendry
Hi guys, prompted by https://twitter.com/davecheney/status/879505821977133057 and writing in to ask for good examples of how to handle HTTP POST uploads simply. And when I mean simply, I mean at the same speed as PHP, 100 meg/sec on my Gigabit LAN. I did try some code yesterday and I was frustr

[go-nuts] [ANN]`go tool trace -diagreedy` Diagnoses the CPU greediest Top N goroutines to gain shorter and more stable GC pause latency

2017-06-26 Thread Ronald
This project added a new sub-option to the `go tool trace` named "diagreedy" which could "diagnose and find out the cpu greediest several goroutines". This tool already helped us tracked down several deep hidden problems in our go applications and achieved more stable and shorter GC pause laten

Re: [go-nuts] Meaning of GC (Dedicated) and GC (Idle) in tracing profile visualizer?

2017-06-26 Thread Ian Lance Taylor
On Mon, Jun 26, 2017 at 2:29 PM, wrote: > > I was using the go tool trace to analyze my program and I noticed two events > named GC (Idle) and GC (Dedicated), does anyone know the distinction between > the two? I cannot find any info about them online. If I were to make an > educated guess I supp

Re: [go-nuts] What does the #+#/#/#+# formatting of the gctrace out put represent, how can I interpret this to discover the total cputime of each of these three phases, what do the / and + demilters m

2017-06-26 Thread Ian Lance Taylor
Search for "gctrace" in https://golang.org/pkg/runtime . Ian -- 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 o

[go-nuts] Meaning of GC (Dedicated) and GC (Idle) in tracing profile visualizer?

2017-06-26 Thread ken . kofi . acquah
Hi Gophers, I was using the go tool trace to analyze my program and I noticed two events named GC (Idle) and GC (Dedicated), does anyone know the distinction between the two? I cannot find any info about them online. If I were to make an educated guess I suppose that GC (Idle) would be the porti

[go-nuts] What does the #+#/#/#+# formatting of the gctrace out put represent, how can I interpret this to discover the total cputime of each of these three phases, what do the / and + demilters mean?

2017-06-26 Thread ken . kofi . acquah
Thanks, Ken -- 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: github.com/golang/glog: Using replacement flag packages

2017-06-26 Thread ivucica
On Monday, June 26, 2017 at 4:21:45 PM UTC+1, Tong Sun wrote: > For *using environment variables with flags*, take a look at > https://github.com/go-easygen/easygen/blob/master/test/commandlineFlag.ref > which has not extra dependencies but the go native flag pkg. > > All you need is to provide

[go-nuts] Go 1.9 Beta 2 is released

2017-06-26 Thread Chris Broadfoot
Hello gophers, We have just released go1.9beta2, a beta version of Go 1.9. It is cut from the master branch at the revision tagged go1.9beta2. There are no known problems or regressions. Please try running production load tests and your unit tests with the new version. Your help testing these pre

[go-nuts] Re: Can i declare a const variable inside a struct in golang

2017-06-26 Thread milanvlach1
No, but you can do better thing! You can declare a method which returns a constant. E.g.: func (a A) GetRoot()(string) { return "MYroot" } Hope this helps, mate! Dne pátek 4. března 2016 23:40:09 UTC+1 krma...@gmail.com napsal(a): > > Something like > > > type A struct { > Root string const

[go-nuts] Re: What is your favorite Go feature?

2017-06-26 Thread prades . marq
There was already an extensive survey published this year asking that kind of question : https://blog.golang.org/survey2016-results You'll already get more data than you want here. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscrib

Re: [go-nuts] Re: How to manage multiple versions of Go?

2017-06-26 Thread fgergo
Sorry, I'll correct myself: godoc.org/golang.org/x/build/version only handles the listed directories. Though if for example you copy an existing directory to go1.8.3 and trivially modify main.go You'll have this: C:\>go build golang.org/x/build/version/go1.8.3 C:\>go1.8.3 version go1.8.3: not down

Re: [go-nuts] Re: How to manage multiple versions of Go?

2017-06-26 Thread fgergo
You can also 'go get' most go versions and it's quite robust. https://twitter.com/golang/status/875117556595515392 On Mon, Jun 26, 2017 at 5:17 PM, Igor Maznitsa wrote: > mvn-golang plugin also allows to automate work with multiple versions of Go > > -- > You received this message because you ar

[go-nuts] What is your favorite Go feature?

2017-06-26 Thread ojucie
*Go has a nice set of features that combines very well with each other.* *John Kenedy's last post put me to think that every Go programmer has a few things he likes the most about Go. If I understood correctly, John preference goes to automatic memory management.* *What is your favorite Go feat

Re: [go-nuts] swig and go - g++4.8 does not have -no-pie

2017-06-26 Thread jkleong
awesome go install is working :) thanks so much! On Monday, June 26, 2017 at 12:06:17 AM UTC-7, Ian Lance Taylor wrote: > > On Sun, Jun 25, 2017 at 9:34 PM, > > wrote: > > Thanks, my gcc and g++ versions were indeed different. I've set them > both to > > 4.8 now and the -no-pie error has gone

Re: [go-nuts] How do you create and use shared libraries in Go?

2017-06-26 Thread st ov
I thought source could be shared and vendored directly as well. But is the buildmode and linkedshared arguments to go install and go build another possibility? What are they for? https://stackoverflow.com/a/30488222 https://stackoverflow.com/a/35060357 Thanks! On Monday, June 26, 2017 at 7:4

Re: [go-nuts] Will cmd/compile/internal/gc be replaced in the future?

2017-06-26 Thread Ian Lance Taylor
On Mon, Jun 26, 2017 at 2:39 AM, Hajime Hoshi wrote: > > It looks like package cmd/compile/internal/gc includes tokenizer, parser or > others for completion, and there are also other packages like go/parser, > go/ast and so on for the same features. As gc code looks likes pretty old > (this was co

[go-nuts] Re: github.com/golang/glog: Using replacement flag packages

2017-06-26 Thread Tong Sun
> I really like the idea of specifying flags in flagfiles and environment variables. For *using environment variables with flags*, take a look at https://github.com/go-easygen/easygen/blob/master/test/commandlineFlag.ref which has not extra dependencies but the go native flag pkg. All you nee

[go-nuts] Re: How to manage multiple versions of Go?

2017-06-26 Thread Igor Maznitsa
mvn-golang plugin also allows to automate work with multiple versions of Go -- 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 t

Re: [go-nuts] How do you create and use shared libraries in Go?

2017-06-26 Thread 'Peter Mogensen' via golang-nuts
On 2017-06-26 09:37, st ov wrote: Ruby has Gems and .NET has DLLs. How do you package and share libraries in Go? Gems are mainly source files, right? ... Using source libraries in Go is relatively straight forward. For your "package main" programs the easiest is to put the library source in "

[go-nuts] Will cmd/compile/internal/gc be replaced in the future?

2017-06-26 Thread Hajime Hoshi
Hi all, It looks like package cmd/compile/internal/gc includes tokenizer, parser or others for completion, and there are also other packages like go/parser, go/ast and so on for the same features. As gc code looks likes pretty old (this was converted from C at Go 1.5 AFAIR), will this be replaced

[go-nuts] [ANN] Stencil - Simple code templating for Go - a proposal and prototype

2017-06-26 Thread sridhar
https://www.laddoo.net/p/stencil This is a simple way of creating generic versions of packages that I've been prototyping. The main idea is summarised below - The generic unit is a package. - Specialise a package by substituting one type for another. - Import statements define type subs

[go-nuts] Re: Attemping a native Go android app, running into gobind error

2017-06-26 Thread Elias Naur
Hi Dan, The gomobile reverse mode is very experimental, much more so than regular gomobile bindings. When in trouble, you'll probably have most luck going back to a working state and then add imports and usages of the reverse packages one at a time. Also, while the reverse bindings can be usef

[go-nuts] Re: How do you create and use shared libraries in Go?

2017-06-26 Thread Nathan Kerr
Go packages are usually source code published in web-accessible repositories such as GitHub. The repositories for packages you want to use are checked out/cloned into GOPATH on your local machine using go get

[go-nuts] How do you create and use shared libraries in Go?

2017-06-26 Thread st ov
Ruby has Gems and .NET has DLLs. How do you package and share libraries in Go? -- 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...@googlegrou

[go-nuts] Re: Attemping a native Go android app, running into gobind error

2017-06-26 Thread Dan Ballard
So one thing slowing me down a bit is that there don't seem to be doc for gobind reverse stuff, I'm just using AndroidStudio and the gobind gradle plugin to call it. I'm not sure how to invoke it manually to try and debug it easier, and it seems the documentation for https://godoc.org/golang.or

Re: [go-nuts] How to manage multiple versions of Go?

2017-06-26 Thread st ov
Thanks for all the references and advice. All the suggested approaches have helped give me sense of how to handle it. On Sunday, June 25, 2017 at 2:08:45 PM UTC-7, Christoph Berger wrote: > > > Could you go into a bit more detail on how you would setup a local > docker container for your Go de

[go-nuts] Re: Attemping a native Go android app, running into gobind error

2017-06-26 Thread Dan Ballard
well, that wasn't so much work, created a code review in gerrit for the gobind GOROOT issue https://go-review.googlesource.com/c/46671/ On Saturday, June 24, 2017 at 7:05:50 AM UTC-7, Dan Ballard wrote: > > I am working on creating an android app entirely in go using the Java og > bindings, as o

Re: [go-nuts] swig and go - g++4.8 does not have -no-pie

2017-06-26 Thread Ian Lance Taylor
On Sun, Jun 25, 2017 at 9:34 PM, wrote: > Thanks, my gcc and g++ versions were indeed different. I've set them both to > 4.8 now and the -no-pie error has gone away. > > I'm seeing warnings from "go build" command regarding syntax in the c++ > library - if they are just warnings, would go install