// typeID generates a reasonable description of a type. Generated tokens
// are attached to the underlying visitation so that we can be sure
// to actually generate them in a subsequent pass.
//   *Foo -> FooPtr
//   []Foo -> FooSlice
//   []*Foo -> FooPtrSlice
//   *[]Foo -> FooSlicePtr
typeID generates a reasonable description of a type. Generated tokens
are attached to the underlying visitation so that we can be sure
to actually generate them in a subsequent pass.
// typeID generates a reasonable description of a type . Generated tokens // are attached to the underlying visitation so that we can be sure // to actually generate them in a subsequent pass . // * Foo - > FooPtr // [] Foo - > FooSlice // [] * Foo - > FooPtrSlice // * [] Foo - > FooSlicePtr
func (v *visitation) typeID(i visitableType) TypeID {
	suffix := ""
	for {
		switch t := i.(type) {
		case pointerType:
			suffix = "Ptr" + suffix
			i = t.Elem
		case namedSliceType:
			suffix = "Slice" + suffix
			i = t.Elem
		case namedVisitableType:
			i = t.Underlying
		default:
			return TypeID(fmt.Sprintf("%sType%s%s", v.Root, t, suffix))
		}
	}
}
func ( v * visitation ) typeID ( i visitableType ) TypeID { suffix := " " for { switch t := i . ( type ) { case pointerType : suffix = " " + suffix i = t . Elem case namedSliceType : suffix = " " + suffix i = t . Elem case namedVisitableType : i = t . Underlying default : return TypeID ( fmt . Sprintf ( " " , v . Root , t , suffix ) ) } } }
typeID generates a reasonable description of a type.
typeID generates a reasonable description of a type .