[go-nuts] Are the tests in the Go source code considered "Unit" tests?

2017-02-14 Thread Dave Cheney
I consider the testing package ideal for unit tests, acceptable for functional tests and out of its depth for integration testing. You can do it, but you end up writing a lot of scaffolding, see the cmd/go tests. -- You received this message because you are subscribed to the Google Groups "go

[go-nuts] how to parse script expression with go and run the script

2017-02-14 Thread hui zhang
I am developing a game engine I wish some event could be trigger by script. and this script expression is self-defined. Like below trigger.ini trigger = "power >= 1000" trigger = "statetype == A || statetype == B " trigger = "foo() > 1" - *power* and *statetype

[go-nuts] Are the tests in the Go source code considered "Unit" tests?

2017-02-14 Thread so . query
>From my understanding Unit Tests should focus on testing a single feature and not use the filesystem. But in the Go source (https://github.com/golang/go) I saw several tests that would violate those conditions. Should we strive to follow more standard conventions in our own unit tests? or are

[go-nuts] Can I set flag when running "go tool pprof" tool?

2017-02-14 Thread nvcnvn
So, instead of > go tool pprof --alloc_objects main heap-profile Can I first go to the interactive mode then some how specific the "alloc_objects" -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivin

[go-nuts] TLS server to save client certificates after a request is received

2017-02-14 Thread Naveen Shivegowda
Hi, I need to store the client certificates in a file for further authentication purpose but I am not able to re-form the client certificates. TLS.PeerCertificates has information related to client certificates but it is separated by struct fields and is not present as byte stream which could b

[go-nuts] Re: Recommended package for SNMP

2017-02-14 Thread Rajanikanth Jammalamadaka
It worked for me fine. I did not use the trap support (which was recently added). -- 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...@googleg

Re: [go-nuts] xattrib on symlinks and holes in syscall support

2017-02-14 Thread Ian Lance Taylor
On Mon, Feb 13, 2017 at 4:45 PM, 'simon place' via golang-nuts wrote: > i have been tidying up some xattrib (extended file attribute) code, and had > what i thought was a cool idea. > > that idea used xattribs on symlinks. > > but when i tried this i found that syscall.Getxattr uses the sys call f

Re: [go-nuts] Any suggestions for slow compile times in 1.7.x and 1.8?

2017-02-14 Thread Mi-e Foame
Thanks for the response! Issue created: https://github.com/golang/go/issues/19096 On Tuesday, February 14, 2017 at 4:33:51 PM UTC-7, Ian Lance Taylor wrote: > > On Tue, Feb 14, 2017 at 3:26 PM, Mi-e Foame > wrote: > > > > Like I said before, most of the Go programs I've compiled in the past >

Re: [go-nuts] Any suggestions for slow compile times in 1.7.x and 1.8?

2017-02-14 Thread Ian Lance Taylor
On Tue, Feb 14, 2017 at 3:26 PM, Mi-e Foame wrote: > > Like I said before, most of the Go programs I've compiled in the past are > usually built within a few seconds at most. I'm not sure what about Go 1.7 > and 1.8 could make such a huge difference in compile times. Any thoughts? I don't know fo

[go-nuts] Any suggestions for slow compile times in 1.7.x and 1.8?

2017-02-14 Thread Mi-e Foame
I wanted to play with https://github.com/trustpath/sequence a little bit and was surprised to find that it took over a minute to compile on my computer (i7-6700K, 64GB RAM, Samsung SSD). Most of the programs I work on in Go are very fast to compile, and this is probably the only outlier I've ev

Re: [go-nuts] Should the order of flags on the command line matter?

2017-02-14 Thread Kale Blankenship
You say that the first works as expected, but they both print "tstst=true". This is because: "You must use the -flag=false form to turn off a boolean flag" (https://golang.org/pkg/flag/). Without the "=", it's ambiguous whether "-tst false" is enabling the flag, followed by a non-flag argument "fa

[go-nuts] Should the order of flags on the command line matter?

2017-02-14 Thread Nico Ma
Hi, First time poster here. I have found what I think is a bug. Compiling the program in https://play.golang.org/p/PIeoe178RG and running it with the string argument first works as expected but the other way does not. If I put the bool var before the string var then it always seem to result in

Re: [go-nuts] Returning an interface using a concrete type?

2017-02-14 Thread Aaron Wood
You're right, I had omitted the implementation by accident. Also, I realized what the issue is. In my real code that I'm working on I had the return type as *Config and not Config. I totally overlooked that, my mistake! On Tuesday, February 14, 2017 at 3:12:43 PM UTC-5, Chris Manghane wrote: >

Re: [go-nuts] Returning an interface using a concrete type?

2017-02-14 Thread 'Chris Manghane' via golang-nuts
Seems to work fine to me: https://play.golang.org/p/6DmDKQLrzd. In your snippet, the concrete type doesn't implement the interface, however. What was the error you got when trying to do apply this to more complicated code. Chris On Tue, Feb 14, 2017 at 12:01 PM, Aaron Wood wrote: > I'm wonderi

[go-nuts] Returning an interface using a concrete type?

2017-02-14 Thread Aaron Wood
I'm wondering why it's not possible to do something like this https://play.golang.org/p/UaRLUvhkgz If a type implements an interface then why can that type not be returned with the method specifying the return type as the interface that it implements? -- You received this message because you

Re: [go-nuts] Select and Gouroutines

2017-02-14 Thread Justin Israel
On Wed, Feb 15, 2017, 6:32 AM Felipe Oliveira < felipeweb.programa...@gmail.com> wrote: > Guys, a select without default locks the execution. but if that select is > in another goroutine it locks the main gourotine too? > The select statement can **block** the current goroutine, if it does not ha

[go-nuts] Re: Recommended package for SNMP

2017-02-14 Thread JM
how did this work out for you? I'm looking at doing some stuff with snmp v3. On Thursday, December 10, 2015 at 8:32:41 PM UTC-7, Rajanikanth Jammalamadaka wrote: > > Thanks Eric. > > Seems like this one: https://github.com/soniah/gosnmp will work for me. > > Will keep your technique as a back

[go-nuts] Select and Gouroutines

2017-02-14 Thread Felipe Oliveira
Guys, a select without default locks the execution. but if that select is in another goroutine it locks the main gourotine too? -- 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, sen

[go-nuts] Re: question on golang.org/x/crypto/acme/autocert

2017-02-14 Thread Tieson Molly
Die, thanks for the post. This is exactly what I was looking for. Best regards, Ty On Tuesday, February 14, 2017 at 11:06:37 AM UTC-5, Diego Medina wrote: > > I wrote this > > https://blog.fmpwizard.com/2016/09/30/automatic-tls-certificates-for-your-go-application/ > > which downloads the cert

[go-nuts] acme/autocert + AppEngine

2017-02-14 Thread Sebastien Binet
hi there, I managed to get the AppEngine tutorial for Go up and running. I managed to get acme/autocert running on some VM, with hugo, serving https and HTTP/2. has somebody worked out how to do the same from AppEngine? thanks, -s -- You received this message because you are subscribed to the

[go-nuts] Re: question on golang.org/x/crypto/acme/autocert

2017-02-14 Thread Diego Medina
I wrote this https://blog.fmpwizard.com/2016/09/30/automatic-tls-certificates-for-your-go-application/ which downloads the certs to a path you specify there is a complete Go app to show how it all works together Thanks Die On Tuesday, February 14, 2017 at 8:11:51 AM UTC-5, Tieson Molly wrot

[go-nuts] weak hash for (MongoDb like) data server

2017-02-14 Thread Basile Starynkevitch
Hello list, I'm just starting to learn and code in Go (but I know well C, C++, Ocaml, Scheme and I am the main designer & implementor of GCC MELT , a Lisp-y domain specific language to customize GCC). I'm using *Go 1.8*rc3 on Debian/Linux/Sid/amd64 (because the plugin f

[go-nuts] question on golang.org/x/crypto/acme/autocert

2017-02-14 Thread Tieson Molly
I am looking for some examples for golang.org/x/crypto/acme/autocert I recently updated my server, and there are some openssl version issues with the letsencrypt certbot that I cannot resolve. I was hoping to find a Go based solution so I could skip these python dependency issues. The ideal s

Re: [go-nuts] efficiency of string <-> []byte conversion

2017-02-14 Thread martisch
some more uses: string([]byte): // Some internal compiler optimizations use this function. // - Used for m[string(k)] lookup where m is a string-keyed map and k is a []byte. // - Used for "<"+string(b)+">" concatenation where b is []byte. // - Used for string(b)=="foo" comparison where b is [