package main
import (
"fmt"
"strconv"
)
func main() {
var a int = 65
b := strconv.Itoa(a)
fmt.Println(b)
a, _ = strconv.Atoi(b)
fmt.Println(a)
}
输出
API server listening at: 127.0.0.1:46998
65
65
Process exiting with code: 0
package main
import (
"fmt"
"strconv"
)
func main() {
var a int = 65
b := strconv.Itoa(a)
fmt.Println(b)
a, _ = strconv.Atoi(b)
fmt.Println(a)
}
输出
API server listening at: 127.0.0.1:46998
65
65
Process exiting with code: 0