From 07a121383c52fc2edb96d4d58d1dd600bc3e7dfd Mon Sep 17 00:00:00 2001 From: Daniel Martí Date: Wed, 19 Feb 2025 22:35:48 +0000 Subject: go/*: use go/types.Func.Signature and go/ast.Preorder In the few obvious candidates that I found after a bit of grepping. Change-Id: I36af79c46d29e4422bce1f43bbbac9db7de2001a Reviewed-on: https://go-review.googlesource.com/c/go/+/650656 Reviewed-by: Alan Donovan Auto-Submit: Alan Donovan Commit-Queue: Alan Donovan Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- src/cmd/api/main_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cmd') diff --git a/src/cmd/api/main_test.go b/src/cmd/api/main_test.go index a0820c2274..ed366be4e7 100644 --- a/src/cmd/api/main_test.go +++ b/src/cmd/api/main_test.go @@ -1058,7 +1058,7 @@ func (w *Walker) emitIfaceType(name string, typ *types.Interface) { if w.isDeprecated(m) { w.emitf("%s //deprecated", m.Name()) } - w.emitf("%s%s", m.Name(), w.signatureString(m.Type().(*types.Signature))) + w.emitf("%s%s", m.Name(), w.signatureString(m.Signature())) } if !complete { @@ -1088,7 +1088,7 @@ func (w *Walker) emitIfaceType(name string, typ *types.Interface) { } func (w *Walker) emitFunc(f *types.Func) { - sig := f.Type().(*types.Signature) + sig := f.Signature() if sig.Recv() != nil { panic("method considered a regular function: " + f.String()) } -- cgit v1.3