update json
This commit is contained in:
@@ -7,13 +7,23 @@ import (
|
||||
|
||||
type Test struct {
|
||||
Name string `json:"name"`
|
||||
Name2 string `json:"name2"`
|
||||
Name3 string `json:"name3,omitempty"`
|
||||
Age int32 `json:"age"`
|
||||
NotSer string `json:"-"`
|
||||
Bool bool `json:"bool"`
|
||||
BoolInStr bool `json:"bool_in_str,string"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
t := Test {
|
||||
Name: "hatter",
|
||||
Name2: "",
|
||||
Name3: "",
|
||||
Age: 18,
|
||||
NotSer: "not ser!",
|
||||
Bool: true,
|
||||
BoolInStr: true,
|
||||
}
|
||||
s, err := json.Marshal(t)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user