diff options
Diffstat (limited to 'internal/typesinternal/types.go')
-rw-r--r-- | internal/typesinternal/types.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/typesinternal/types.go b/internal/typesinternal/types.go index ce7d4351b..3c53fbc63 100644 --- a/internal/typesinternal/types.go +++ b/internal/typesinternal/types.go @@ -11,6 +11,8 @@ import ( "go/types" "reflect" "unsafe" + + "golang.org/x/tools/go/types/objectpath" ) func SetUsesCgo(conf *types.Config) bool { @@ -50,3 +52,10 @@ func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, } var SetGoVersion = func(conf *types.Config, version string) bool { return false } + +// NewObjectpathEncoder returns a function closure equivalent to +// objectpath.For but amortized for multiple (sequential) calls. +// It is a temporary workaround, pending the approval of proposal 58668. +// +//go:linkname NewObjectpathFunc golang.org/x/tools/go/types/objectpath.newEncoderFor +func NewObjectpathFunc() func(types.Object) (objectpath.Path, error) |