MCPcopy Create free account
hub / github.com/Go-Learning-Land/Go-Learning-Archive / String

Method String

GolangBasics/GoByExample/051xml.go:15–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15func (p Plant) String() string {
16 return fmt.Sprintf("Plant id=%v, name=%v, origin=%v",
17 p.Id, p.Name, p.Origin)
18}
19
20func main() {
21 coffee := &Plant{Id: 27, Name: "Coffee"}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected