Answers for "printing fields of the structure with their names in golang"

Go
2

printing fields of the structure with their names in golang

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}
Posted by: Guest on July-03-2021

Code answers related to "printing fields of the structure with their names in golang"

Browse Popular Code Answers by Language