Closed
Description
Given input:
package a
type Num int
// Small numbers
const (
One Num = iota
Two
)
// Big numbers
const (
Fourteen Num = iota
EleventyOne
)
stringer generates strings only for the first group:
// generated by stringer -type=Num; DO NOT EDIT
package a
import "fmt"
const _Num_name = "OneTwo"
var _Num_index = [...]uint8{0, 3, 6}
func (i Num) String() string {
if i < 0 || i+1 >= Num(len(_Num_index)) {
return fmt.Sprintf("Num(%d)", i)
}
return _Num_name[_Num_index[i]:_Num_index[i+1]]
}