File tree 1 file changed +23
-18
lines changed 1 file changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -891,25 +891,30 @@ func hasPrefix(s, prefix string) bool {
891
891
892
892
func (t * rtype ) Name () string {
893
893
s := t .String ()
894
- if hasPrefix (s , "map[" ) {
895
- return ""
896
- }
897
- if hasPrefix (s , "struct {" ) {
898
- return ""
899
- }
900
- if hasPrefix (s , "chan " ) {
901
- return ""
902
- }
903
- if hasPrefix (s , "chan<-" ) {
904
- return ""
905
- }
906
- if hasPrefix (s , "func(" ) {
907
- return ""
908
- }
909
- if hasPrefix (s , "interface {" ) {
910
- return ""
911
- }
912
894
switch s [0 ] {
895
+ case 'm' :
896
+ if hasPrefix (s , "map[" ) {
897
+ return ""
898
+ }
899
+ case 's' :
900
+ if hasPrefix (s , "struct {" ) {
901
+ return ""
902
+ }
903
+ case 'c' :
904
+ if hasPrefix (s , "chan " ) {
905
+ return ""
906
+ }
907
+ if hasPrefix (s , "chan<-" ) {
908
+ return ""
909
+ }
910
+ case 'f' :
911
+ if hasPrefix (s , "func(" ) {
912
+ return ""
913
+ }
914
+ case 'i' :
915
+ if hasPrefix (s , "interface {" ) {
916
+ return ""
917
+ }
913
918
case '[' , '*' , '<' :
914
919
return ""
915
920
}
You can’t perform that action at this time.
0 commit comments