int to string
import (
"strconv"
)
int i = 10
str1 := strconv.Itoa(i)
struct to json
import (
"encoding/json"
)
type Server struct {
ServerName string
ServerIP string
}
b, err := json.Marshal(s)
if err != nil {
fmt.Println("json err:", err)
}
fmt.Println(string(b))
未完待续