Answers for "golang print struct name"

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("%+vn", t)  //output:  &{a:7 b:-2.35 c:abc}
Posted by: Guest on July-03-2021

Code answers related to "golang print struct name"

Browse Popular Code Answers by Language