Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Manlio Perillo
On Tue, Feb 21, 2017 at 11:29 PM, andrey mirtchovski wrote: > You can try binary.Size but you'll also run into the same problem: > int's size is platform specific (binary.Size returns -1 for ints). As > the go faq states "For portability, code that relies on a particular >

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread andrey mirtchovski
You can try binary.Size but you'll also run into the same problem: int's size is platform specific (binary.Size returns -1 for ints). As the go faq states "For portability, code that relies on a particular size of value should use an explicitly sized type, like int64." -- You received this

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Manlio Perillo
Il giorno martedì 21 febbraio 2017 23:00:44 UTC+1, Matt Harden ha scritto: > > Sizeof does exist in the unsafe package and returns a compile time > constant. > > One usually don't want to import the unsafe package just to use the Sizeof function in a safe package. This is the reason why I'm

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Matt Harden
Sizeof does exist in the unsafe package and returns a compile time constant. On Tue, Feb 21, 2017, 13:56 Manlio Perillo wrote: > Il giorno martedì 21 febbraio 2017 22:14:38 UTC+1, Ian Lance Taylor ha > scritto: > > On Tue, Feb 21, 2017 at 9:51 AM, Manlio Perillo >

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Caleb Spare
Like unsafe.Sizeof? On Tue, Feb 21, 2017 at 1:56 PM, Manlio Perillo wrote: > Il giorno martedì 21 febbraio 2017 22:14:38 UTC+1, Ian Lance Taylor ha > scritto: >> >> On Tue, Feb 21, 2017 at 9:51 AM, Manlio Perillo >> wrote: >> > I have noted that

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Manlio Perillo
Il giorno martedì 21 febbraio 2017 22:14:38 UTC+1, Ian Lance Taylor ha scritto: > > On Tue, Feb 21, 2017 at 9:51 AM, Manlio Perillo > wrote: > > I have noted that the intValue (and uintValue) Set method do the > following: > > v, err := strconv.ParseInt(s, 0, 64)

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Ian Lance Taylor
On Tue, Feb 21, 2017 at 9:51 AM, Manlio Perillo wrote: > I have noted that the intValue (and uintValue) Set method do the following: > v, err := strconv.ParseInt(s, 0, 64) > > However this is incorrect on 32 bit systems: > https://play.golang.org/p/tvAUCI63x3 > > Can

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Alexander Kapshuk
On Tue, Feb 21, 2017 at 9:13 PM, Alexander Kapshuk wrote: > On Tue, Feb 21, 2017 at 7:51 PM, Manlio Perillo > wrote: >> I have noted that the intValue (and uintValue) Set method do the following: >> v, err := strconv.ParseInt(s, 0, 64)

Re: [go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Alexander Kapshuk
On Tue, Feb 21, 2017 at 7:51 PM, Manlio Perillo wrote: > I have noted that the intValue (and uintValue) Set method do the following: > v, err := strconv.ParseInt(s, 0, 64) > > However this is incorrect on 32 bit systems: > https://play.golang.org/p/tvAUCI63x3 > > Can

[go-nuts] flag: possible issue with intValue.Set

2017-02-21 Thread Manlio Perillo
I have noted that the intValue (and uintValue) Set method do the following: v, err := strconv.ParseInt(s, 0, 64) However this is incorrect on 32 bit systems: https://play.golang.org/p/tvAUCI63x3 Can this be considered a bug? Another, minor, issue is that: *i = intValue(v) return err i is