Question : printing fields of the structure with their names in golang
Answered by : atif-anowar
type T struct { a int b float64 c string
}
t := &T{ 7, -2.35, "abc" }
fmt.Printf("%+v\n", t) //output: &{a:7 b:-2.35 c:abc}
Source : | Last Update : Sat, 10 Jul 21