Skip to content

Commit

Permalink
go/types, types2: delete TypeList.String
Browse files Browse the repository at this point in the history
This method is unused and was not discussed in the API
proposals. Note that all error output goes through the
local sprintf which handles arguments specially.

Fixes #50760.

Change-Id: Iae66b0253cc0ece037d3d280951dc2d223c119fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/381634
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
  • Loading branch information
griesemer committed Jan 28, 2022
1 parent 8f7d96f commit b37c6e1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion api/go1.18.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pkg go/types, method (*Term) Tilde() bool
pkg go/types, method (*Term) Type() Type
pkg go/types, method (*TypeList) At(int) Type
pkg go/types, method (*TypeList) Len() int
pkg go/types, method (*TypeList) String() string
pkg go/types, method (*TypeParam) Constraint() Type
pkg go/types, method (*TypeParam) Index() int
pkg go/types, method (*TypeParam) Obj() *TypeName
Expand Down
11 changes: 0 additions & 11 deletions src/cmd/compile/internal/types2/typelists.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

package types2

import "bytes"

// TypeParamList holds a list of type parameters.
type TypeParamList struct{ tparams []*TypeParam }

Expand Down Expand Up @@ -54,15 +52,6 @@ func (l *TypeList) list() []Type {
return l.types
}

func (l *TypeList) String() string {
if l == nil || len(l.types) == 0 {
return "[]"
}
var buf bytes.Buffer
newTypeWriter(&buf, nil).typeList(l.types)
return buf.String()
}

// ----------------------------------------------------------------------------
// Implementation

Expand Down
11 changes: 0 additions & 11 deletions src/go/types/typelists.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

package types

import "bytes"

// TypeParamList holds a list of type parameters.
type TypeParamList struct{ tparams []*TypeParam }

Expand Down Expand Up @@ -54,15 +52,6 @@ func (l *TypeList) list() []Type {
return l.types
}

func (l *TypeList) String() string {
if l == nil || len(l.types) == 0 {
return "[]"
}
var buf bytes.Buffer
newTypeWriter(&buf, nil).typeList(l.types)
return buf.String()
}

// ----------------------------------------------------------------------------
// Implementation

Expand Down

0 comments on commit b37c6e1

Please sign in to comment.