[go-nuts] Hosting go code in Visual Studio Team Services

2017-09-03 Thread Sotirios Mantziaris
Hi, has someone successfully used visual studio team services in a go project with support of the go tooling (go get, glide-dep etc)? thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emai

[go-nuts] Question about plugins & types

2017-09-03 Thread Miki Tebeka
Hi, Assume I have a plugin: package main func Add(x, y int) int { return x + y } func main() {} I'd like to make sure that plugin functions are from certain type. So I wrote (ignore panics, they are for brevity): Enter code here...package main import ( "fmt" "plugin" ) type MathFunc func(int

Re: [go-nuts] Question about plugins & types

2017-09-03 Thread 'Axel Wagner' via golang-nuts
type MathFunc func(int, int) int declares a *new* type, called MathFunc, with underlying type func(int, int) int, which is why the type-assertion fails - you are checking whether the type is *exactly* MathFunc, not "has the same underlying type". There are several things you could do, apart from w

[go-nuts] Re: Running Go binary on a 56 core VM

2017-09-03 Thread rlh via golang-nuts
Without building and measuring it is impossible to know which of these approaches, or even a third one where you simply run a single instance, is best for your application. Each approach has upsides and downsides. The GC believes GOMAXPROCS and will uses as much CPU as it believes is available.

[go-nuts] Splitting CamelCaseWords in Go

2017-09-03 Thread Tong Sun
Hi, I need to split "CamelCaseWords" into individual words like "Camel Case Words". The following is the Perl code that I get for doing just that: @words = $words[0] =~ /[A-Z][^A-Z]*/g if @words == 1 && $words[0] =~ /^[A-Z]/; However, I've been staring at it long enough to confirm

[go-nuts] Best way to launch/monitor several go process in production

2017-09-03 Thread emartinez1847
Hello, I am looking for the 'best' way to launch and monitor several go processes. Doing it with just 1 is easy enough, using monit or systemctl should do the trick, however since our app takes a while to start, we want to keep a few proceses running at all times so we don't have downtime every

Re: [go-nuts] Struct overloading method issue

2017-09-03 Thread Tong Sun
On Sunday, September 3, 2017 at 1:51:54 AM UTC-4, Jesse McNelis wrote: > > On Sat, Sep 2, 2017 at 12:50 AM, BeaT Adrian > wrote: > > Hello, I ran into a strange scenario and I wanted to know if there is a > > better solution for it > > > > type A struct{} > > > > func (a *A) private() {}

Re: [go-nuts] Splitting CamelCaseWords in Go

2017-09-03 Thread Seth Bunce
https://play.golang.org/p/-FM2wC22A0 My inclination would be to go for an approach like this. Then make a table-driven unit test and throw everything you can think of at it and iterate until you get what you need. On Sun, Sep 3, 2017 at 2:23 PM, Tong Sun wrote: > Hi, > > I need to split "CamelC

[go-nuts] Same code different result?

2017-09-03 Thread Tong Sun
Hi, I've bumped into another "same code different result" problem -- my `go test` runs fine locally but on Travis, https://travis-ci.org/go-dedup/fsimilar/builds/271540570 it is broken. I've verified at least four or five times that *all* my local code have been pushed to github. Now I've ru

[go-nuts] Re: Same code different result?

2017-09-03 Thread Tong Sun
On Sunday, September 3, 2017 at 11:34:51 PM UTC-4, Tong Sun wrote: > > Hi, > > I've bumped into another "same code different result" problem -- my `go > test` runs fine locally but on Travis, > https://travis-ci.org/go-dedup/fsimilar/builds/271540570 > it is broken. > Just in case somebody

Re: [go-nuts] Splitting CamelCaseWords in Go

2017-09-03 Thread Tong Sun
On Sun, Sep 3, 2017 at 6:05 PM, Seth Bunce wrote: > https://play.golang.org/p/-FM2wC22A0 > Thanks a lot Seth! FTR, I archived it in my personal treasure chest at https://github.com/suntong/lang/blob/master/lang/Go/src/text/CamelCaseSplit.go with a little bit enhancement. -- You received this m

[go-nuts] golang gc stop the world how to stop cpu busy goroutine?

2017-09-03 Thread 刘桂祥
when have one or two cpu busy goroutine in my server (example for loop empty), the gc stop the world how to stop the goroutine ? -- 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] Re: Running Go binary on a 56 core VM

2017-09-03 Thread Linker
More File-IO, more GOMAXPROCS. On Mon, Sep 4, 2017 at 3:44 AM, rlh via golang-nuts < golang-nuts@googlegroups.com> wrote: > Without building and measuring it is impossible to know which of these > approaches, or even a third one where you simply run a single instance, is > best for your applicati

Re: [go-nuts] Same code different result?

2017-09-03 Thread Jakob Borg
Hi, It's not especially clear from your mail what your tool does, exactly. But assuming that it calculates hashes of content in some manner, my first guess would be that your test data character set and/or line endings get changed by the git checkin/checkout procedure. //jb > On 4 Sep 2017, a

RE: [go-nuts] golang gc stop the world how to stop cpu busy goroutine?

2017-09-03 Thread John Souvestre
Although a goroutine isn’t pre-emptible by the Go scheduler, there is an opportunity whenever it does something which blocks or when it calls a non-inlined function. So generally the GC’s STW can take place pretty quickly. But if you are doing something with is totally compute bound then it ca

RE: [go-nuts] Re: Running Go binary on a 56 core VM

2017-09-03 Thread John Souvestre
There are lots of variables, but even with a directly connected SSD drive (SATA bus, in my case) I can pretty well top out the file i/o, just doing sequential file reads, with about 3 – 4 CPUs. So increasing GOMAXPROCS (in this case) doesn’t help. John John Souvestre - New Orleans LA