type A struct { Name string Level int } type B struct { Skill string } func main() { a := A{"Momo", 1} b := B{"Starfall"} // outputs // {"Momo", 1} // {"Starfall"} clear(a) clear(b) // outputs // { , 0} // { } } func clear(v interface{}) { p := reflect.ValueOf(v).Elem() p.Set(reflect.Zero(p.Type())) }