code: func extractTypeName(tip string) string {
  	// trim all spaces
  	tip = strings.TrimSpace(tip)
  
  	// detect array
  	if strings.Index(tip, "]") < 0 {
  		return tip
  	}
  
  	// find type inside square bracket
  	inBracket := reSquareBracket.FindString(tip)
  	if inBracket == "" {
  		return tip
  	}
  	last := strings.LastIndex(inBracket, "[")
  	inBracket = inBracket[last+1:]
  	return strings.TrimSuffix(inBracket, "]")
  }
docs: // extract type name from potentially complex type declaration