package main import ( "encoding/json" "fmt" "testProject/test" ) func main() { user := test.User{} user.Address = "sadsda" user.Password = "123456" user.UserName = "仙士可" bytes, _ := json.Marshal(user) fmt.Println(string(bytes)) }
package main import ( "encoding/json" "fmt" "testProject/test" ) func main() { user := test.User{} user.Address = "sadsda" user.Password = "123456" user.UserName = "仙士可" bytes, _ := json.Marshal(user) fmt.Println(string(bytes)) }