diff --git a/README b/README index 3a51d00..5cbebcb 100644 --- a/README +++ b/README @@ -84,3 +84,4 @@ gobyexample.com signups * connection pool * ruby enumerable * ruby string +* quoting diff --git a/src/xx-convert.go b/src/xx-convert.go new file mode 100644 index 0000000..1a5216b --- /dev/null +++ b/src/xx-convert.go @@ -0,0 +1,20 @@ +package main + +import ("fmt"; "strconv") + +func main() { + b, _ := strconv.ParseBool("true") + fmt.Println(b) + + f, _ := strconv.ParseFloat("1.234", 64) + fmt.Println(f) + + i, _ := strconv.ParseInt("123", 0, 64) + fmt.Println(i) + + d, _ := strconv.ParseInt("0x1b3e", 0, 64) + fmt.Println(d) + + k, _ := strconv.Atoi("456") + fmt.Println(k) +}