编辑代码

package main
import (
    "fmt"
    "encoding/json"
)

type Person struct {
    Name   string `json:"name"`
    age    int8   `json:"age"`
    IsMale bool   `json:"is_male,omitempty"`
    haha   string `json:haha,omitempty`
}

func main () {
    
    aa := &Person{
        Name: "Alice",
        age: 18,
        IsMale: false,
        haha: "",
    }

    bb, _ := json.Marshal(aa)
    fmt.Printf("Test: %v", string(bb))
}