Re: [go-nuts] Installing a package

2017-07-02 Thread suburb4nfilth
I do not have two elements in my path o.O The only path in my GOPATH is ''/home/Documents/GoProjects''. On Monday, July 3, 2017 at 1:27:09 AM UTC+3, Matt Harden wrote: > > Move that to the beginning of your GOPATH (first entry instead of last) > and it should work for you. > > By the way, I norm

[go-nuts] Re: My examples gone from GoDoc site

2017-07-02 Thread Tong Sun
On Sunday, July 2, 2017 at 10:30:12 PM UTC-4, Tong Sun wrote: > > I found my examples are now gone from GoDoc site, but don't know what has > triggered it. > > From here, > http://godoc.org/gopkg.in/go-dedup/simhash.v1#NewUnicodeWordFeatureSet > You can see *two examples listed* under my func

Re: [go-nuts] Any way to exec a process and make sure it dies when the parent panics?

2017-07-02 Thread Dragos Harabor
There is no way to recover panics in TestMain and it's the expected behavior. Please read through this issue: https://github.com/golang/go/issues/13149 On Sunday, July 2, 2017 at 8:43:45 PM UTC-7, Shawn Milochik wrote: > > Have you tried recover () in func TestMain(m *testing.M)? > -- You recei

Re: [go-nuts] Any way to exec a process and make sure it dies when the parent panics?

2017-07-02 Thread Shawn Milochik
Have you tried recover () in func TestMain(m *testing.M)? -- 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 optio

Re: [go-nuts] Any way to exec a process and make sure it dies when the parent panics?

2017-07-02 Thread Dragos Harabor
There is no main(). I'm talking about tests using TestMain(*testing.M) On Sunday, July 2, 2017 at 7:47:01 PM UTC-7, Shawn Milochik wrote: > > You can use recover() in your main(). > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Any way to exec a process and make sure it dies when the parent panics?

2017-07-02 Thread Shawn Milochik
You can use recover() in your main(). -- 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://gr

[go-nuts] My examples gone from GoDoc site

2017-07-02 Thread Tong Sun
I found my examples are now gone from GoDoc site, but don't know what has triggered it. >From here, http://godoc.org/gopkg.in/go-dedup/simhash.v1#NewUnicodeWordFeatureSet You can see *two examples listed* under my func NewUnicodeWordFeatureSet

Re: [go-nuts] unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Dan Kortschak
Thanks Rémy. Welcome back. On Sun, 2017-07-02 at 09:04 +0200, Rémy Oudompheng wrote: > 2017-07-02 6:20 GMT+02:00 Dan Kortschak u>: > > > > Is this expected: > > > > ``` > > package main > > > > import ( > > "fmt" > > "strconv" > > ) > > > > func main() { > > fmt.Print

[go-nuts] Just launched a new Go Community Site

2017-07-02 Thread Glen Newton
Suggest displaying timestamp of entries. Very annoying (read 'very un-useful') to look through such a list without a published date/time... -- 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] Any way to exec a process and make sure it dies when the parent panics?

2017-07-02 Thread Dragos Harabor
I'm interested in making this work for recent versions of Linux and MacOS only at this time. The problem: in tests I'm using TestMain to start a process/server that I cannot modify the behavior of by changing the source (e.g. an external Redis server). Using defers I can tell the server to exit

Re: [go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Uli Kunitz
You are correct, there is no difference with C printf for these values. -- 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.

Re: [go-nuts] Installing a package

2017-07-02 Thread Matt Harden
Move that to the beginning of your GOPATH (first entry instead of last) and it should work for you. By the way, I normally only have one entry in my GOPATH. Out of curiosity, why do you have more than one? On Sun, Jul 2, 2017, 14:20 Martin Spasov wrote: > hey, my src, pkg and bin directories ar

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Sun, Jul 2, 2017 at 4:34 PM, Sam Whited wrote: > This means that the code you pasted is the same as if you'd written: > > type ByteSize float64 > > const ( > _ = 0 // ignore first value by assigning to blank identifier > KB ByteSize = 1 << (10 * 1) > MB

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Fri, Jun 30, 2017 at 10:23 PM, Manohar Reddy wrote: > `iota` is golnag's enum. I've seen this code in Wikipedia. But I did not > understand it. Can someone please explain this code? This is slightly nitpicky since many languages don't use enums for much more than what iota does, but iota actua

Re: [go-nuts] Installing a package

2017-07-02 Thread Martin Spasov
hey, my src, pkg and bin directories are in the GoProjects folder which is the last one in the path On Mon, Jul 3, 2017 at 12:17 AM, Justin Israel wrote: I think two different things are being described here. GOPATH=/path/to/src:/path/to/src2 The first path should be the one that gets the pkg

Re: [go-nuts] Installing a package

2017-07-02 Thread Justin Israel
I think two different things are being described here. GOPATH=/path/to/src:/path/to/src2 The first path should be the one that gets the pkg install location. On Mon, Jul 3, 2017, 9:02 AM Martin Spasov wrote: > Does that mean that it is not possible to chose where you want to install > the pkg

Re: [go-nuts] Installing a package

2017-07-02 Thread Martin Spasov
Does that mean that it is not possible to chose where you want to install the pkg ? On Mon, Jul 3, 2017 at 12:00 AM, Matt Harden wrote: I believe it's the first folder in GOPATH, not the last. On Sun, Jul 2, 2017 at 1:21 PM wrote: From what I found here when you install packages with go get,

Re: [go-nuts] Installing a package

2017-07-02 Thread Matt Harden
I believe it's the first folder in GOPATH, not the last. On Sun, Jul 2, 2017 at 1:21 PM wrote: > From what I found here when you install packages with go get, they get > installed in the last folder of your GOPATH env variable. Mine is > ''/home/Documents/GoProjects'' but the installed packages

[go-nuts] Installing a package

2017-07-02 Thread suburb4nfilth
>From what I found here when you install packages with go get, they get installed in the last folder of your GOPATH env variable. Mine is ''/home/Documents/GoProjects'' but the installed packages end up in ''/home''. It is probably a stupid question, but I honestly do not know what is wrong her

[go-nuts] Re: Go type chart

2017-07-02 Thread Tong Sun
That's wonderful. Thanks Nathan! On Sunday, July 2, 2017 at 3:33:18 AM UTC-4, Nathan Kerr wrote: > > Are you wanting something like https://github.com/gmarik/go-erd? > > On Saturday, July 1, 2017 at 8:19:27 PM UTC+2, Tong Sun wrote: >> >> Hi, >> >> Any exiting tools out there for Go type chart, t

Re: [go-nuts] Re: gofmt question

2017-07-02 Thread Glenn Hancock
Good points and I'm obviously going to deal with it. :-) Its sorta like all those agreements we click off on when we install software we just purchased. As if we have any other option but to agree to whatever the demands. :-) I'm already getting past it, just frustrating in some respects. T

Re: [go-nuts] Re: gofmt question

2017-07-02 Thread Tyler Compton
Another nice aspect of this is that formatting consistency is ecosystem-wide instead of company-wide. On Sat, Jul 1, 2017 at 9:43 AM Shawn Milochik wrote: > On Sat, Jul 1, 2017 at 11:40 AM, Glenn Hancock wrote: > >> Thanks for the responses. I guess I'll just deal with it. While I can >> unde

[go-nuts] Re: runtime/malloc: out of memory when only 512GB / 4TB in use

2017-07-02 Thread Jeremy Jay
On Sunday, July 2, 2017 at 3:58:38 AM UTC-4, Sokolov Yura wrote: > > If you have a lot of "raw" data (ie without pointers), consider moving it > into mmap-ed slice. You will loose convenience of GC though (you will have > to manage those memory by yourself). This was definitely on my list if n

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-02 Thread ikedamdam
> I don’t see an obvious way of expressing the example hour (15) in a way that would imply “24 hour format, but no zero padding”. I agree with that. It's difficult to decide an example format for 24-hour without zero padding as a part of the standard feature. And that makes me believe the custo

Re: [go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Rémy Oudompheng
There is no floating point number which is exactly equal to either 0.05 or 0.15 so in your examples the simple "round to nearest" rule apply (no tie implied). Rémy. Le 2 juil. 2017 9:15 AM, "Uli Kunitz" a écrit : One could justify it, if the rounding rule is "rounding to nearest, ties to even"

[go-nuts] runtime/malloc: out of memory when only 512GB / 4TB in use

2017-07-02 Thread Sokolov Yura
If you have a lot of "raw" data (ie without pointers), consider moving it into mmap-ed slice. You will loose convenience of GC though (you will have to manage those memory by yourself). BTW, share your experience with such huge heap on Go. Does GC perform well? Looks like you are first person wh

[go-nuts] Re: Go type chart

2017-07-02 Thread Nathan Kerr
Are you wanting something like https://github.com/gmarik/go-erd? On Saturday, July 1, 2017 at 8:19:27 PM UTC+2, Tong Sun wrote: > > Hi, > > Any exiting tools out there for Go type chart, to visualize the > relationships of different user defined Go types? Thx. > > > -- You received this messa

[go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Uli Kunitz
One could justify it, if the rounding rule is "rounding to nearest, ties to even". I find other behaviour more strange: -0.5 is rounded to -0 with prec=0 -0.05 is rounded to -0.1 with prec=1 0.15 rounded to 0.1 with prec=1 -- You received this message because you are subscribed to the Google G

Re: [go-nuts] unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Rémy Oudompheng
2017-07-02 6:20 GMT+02:00 Dan Kortschak : > Is this expected: > > ``` > package main > > import ( > "fmt" > "strconv" > ) > > func main() { > fmt.Print(strconv.FormatFloat(0.5, 'f', 0, 64)) > } > ``` > > ``` > 0 > ``` > > https://play.golang.org/p/HEyxpGPrX3 > > This is trun