()
| 20 | } |
| 21 | |
| 22 | func (s *MethodSet) String() string { |
| 23 | if s.Len() == 0 { |
| 24 | return "MethodSet {}" |
| 25 | } |
| 26 | |
| 27 | var buf strings.Builder |
| 28 | fmt.Fprintln(&buf, "MethodSet {") |
| 29 | for _, f := range s.list { |
| 30 | fmt.Fprintf(&buf, "\t%s\n", f) |
| 31 | } |
| 32 | fmt.Fprintln(&buf, "}") |
| 33 | return buf.String() |
| 34 | } |
| 35 | |
| 36 | // Len returns the number of methods in s. |
| 37 | func (s *MethodSet) Len() int { return len(s.list) } |