Re: [go-nuts] time.Truncate output is _slightly_ different than expected

2016-11-12 Thread Brian Picciano
e another, much earlier, reference > time. The remainder in that division will be different. > > //jb > > On 11 Nov 2016, at 15:53, Brian Picciano wrote: > > Here's a test case to show what I mean: > > func TestWat(t *T) { > now := time.Now() > trunc := rand

[go-nuts] time.Truncate output is _slightly_ different than expected

2016-11-11 Thread Brian Picciano
Here's a test case to show what I mean: func TestWat(t *T) { now := time.Now() trunc := rand.Int63n(int64(time.Second)) t.Logf("trunc: %v", trunc) t1 := now.Truncate(time.Duration(trunc)) t2 := time.Unix(0, trunc*(now.UnixNano()/trunc)) // this fails for some reason assert.Equal(t, t1, t2) } Fo

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
t; unmarshalling. Document the expectations for the library user. :) > > //jb > > > ons 19 okt. 2016 kl 23:25 skrev Brian Picciano : > > Hi Ian! I don't think that would work, my data can be pretty much any > arbitrary data, including binary data. So I would need t

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
wrote: > > On Wed, Oct 19, 2016, at 03:34 PM, Brian Picciano wrote: > > Hi there! My use-case involves reading all data off of an io.Reader and > scanning it into a receiver value provided by the user of my library. In > many ways the same thing as fmt.Fscan. The difference is t

[go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
Hi there! My use-case involves reading all data off of an io.Reader and scanning it into a receiver value provided by the user of my library. In many ways the same thing as fmt.Fscan. The difference is that only one receiver value is allowed, and I want to read _all_ data until io.EOF, not just