Printing Fields Of The Structure With Their Names In Golang

[Solved] Printing Fields Of The Structure With Their Names In Golang | Go - Code Explorer | yomemimo.com
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

Answers related to printing fields of the structure with their names in golang

Code Explorer Popular Question For Go