@@ -83,7 +83,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
8383 // of S and the respective parameter passing rules apply."
8484 S := x .typ
8585 var T Type
86- if s , _ := singleUnder (S ).(* Slice ); s != nil {
86+ if s , _ := structure (S ).(* Slice ); s != nil {
8787 T = s .elem
8888 } else {
8989 check .invalidArg (x , _InvalidAppend , "%s is not a slice" , x )
@@ -332,14 +332,14 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
332332
333333 case _Copy :
334334 // copy(x, y []T) int
335- dst , _ := singleUnder (x .typ ).(* Slice )
335+ dst , _ := structure (x .typ ).(* Slice )
336336
337337 var y operand
338338 arg (& y , 1 )
339339 if y .mode == invalid {
340340 return
341341 }
342- src , _ := singleUnderString (y .typ ).(* Slice )
342+ src , _ := structureString (y .typ ).(* Slice )
343343
344344 if dst == nil || src == nil {
345345 check .invalidArg (x , _InvalidCopy , "copy expects slice arguments; found %s and %s" , x , & y )
@@ -473,7 +473,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
473473 }
474474
475475 var min int // minimum number of arguments
476- switch singleUnder (T ).(type ) {
476+ switch structure (T ).(type ) {
477477 case * Slice :
478478 min = 2
479479 case * Map , * Chan :
@@ -776,11 +776,11 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
776776 return true
777777}
778778
779- // If typ is a type parameter, single under returns the single underlying
780- // type of all types in the corresponding type constraint if it exists, or
781- // nil if it doesn't exist . If typ is not a type parameter, singleUnder
782- // just returns the underlying type.
783- func singleUnder (typ Type ) Type {
779+ // If typ is a type parameter, structure returns the single underlying
780+ // type of all types in the corresponding type constraint if it exists,
781+ // or nil otherwise . If typ is not a type parameter, structure returns
782+ // the underlying type.
783+ func structure (typ Type ) Type {
784784 var su Type
785785 if underIs (typ , func (u Type ) bool {
786786 if su != nil && ! Identical (su , u ) {
@@ -795,10 +795,10 @@ func singleUnder(typ Type) Type {
795795 return nil
796796}
797797
798- // singleUnderString is like singleUnder but also considers []byte and
799- // string as "identical". In this case, if successful, the result is always
800- // []byte.
801- func singleUnderString (typ Type ) Type {
798+ // structureString is like structure but also considers []byte and
799+ // string as "identical". In this case, if successful, the result
800+ // is always []byte.
801+ func structureString (typ Type ) Type {
802802 var su Type
803803 if underIs (typ , func (u Type ) bool {
804804 if isString (u ) {
0 commit comments