No need to convert what ParseInt returns to an int64
This commit is contained in:
committed by
İnanç Gümüş
parent
7888d7844b
commit
455532393c
@ -35,8 +35,9 @@ func main() {
|
|||||||
fmt.Println("int32 value is:", int32(val))
|
fmt.Println("int32 value is:", int32(val))
|
||||||
|
|
||||||
// 4th argument is an int64
|
// 4th argument is an int64
|
||||||
|
// Remember ParseInt returns an int64
|
||||||
val, _ = strconv.ParseInt(os.Args[4], 10, 64)
|
val, _ = strconv.ParseInt(os.Args[4], 10, 64)
|
||||||
fmt.Println("int64 value is:", int64(val))
|
fmt.Println("int64 value is:", val)
|
||||||
|
|
||||||
// 5th argument is a number in bits. And its int8.
|
// 5th argument is a number in bits. And its int8.
|
||||||
// ParseInt(.., 2, ...) -> 2 means binary base
|
// ParseInt(.., 2, ...) -> 2 means binary base
|
||||||
|
Reference in New Issue
Block a user