MCPcopy Index your code
hub / github.com/mikespook/Learning-Go-zh-cn / String

Method String

ex-functions/src/stack.go:23–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func (s *stack) String() string {
24 var str string
25 for i := 0; i < s.i; i++ {
26 str = str + "[" +
27 strconv.Itoa(i) + ":" + strconv.Itoa(s.data[i]) + "]"
28 }
29 return str
30}
31
32func main() {
33 s := new(stack) // returns pointer!

Callers 3

mainFunction · 0.45
mainFunction · 0.45
EchoFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected