diff options
| author | Alan Donovan <adonovan@google.com> | 2025-02-12 11:18:30 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-02-15 08:06:58 -0800 |
| commit | 586e205522279406a9fcd2ab6cd1a1f416f1eae4 (patch) | |
| tree | 3481a94a78e2a2af045b4b5873329a492da9161b /src/cmd/compile/internal/noder/noder.go | |
| parent | beac2f7d3b72ecaff146b98afb690489f0192422 (diff) | |
| download | go-586e205522279406a9fcd2ab6cd1a1f416f1eae4.tar.xz | |
std: add //go:fix inline directives to some deprecated functions
In particular, we apply it only to functions where it is always
a code improvement to inline the call.
We also apply it to some constants.
In a few cases this may introduce a panic statement at the
caller, which is debatable, but making the potential for panic
evident is the purpose of the deprecation.
The gofix analyzer in gopls v0.18 will show a diagnostic for calls
to the annotated functions, and will offer to inline the call.
The new //go:fix annotation needs a special exemption in the
pragma check in the compiler.
Updates #32816
Change-Id: I43bf15648ac12251734109eb7102394f8a76d55e
Reviewed-on: https://go-review.googlesource.com/c/go/+/648995
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/noder.go')
| -rw-r--r-- | src/cmd/compile/internal/noder/noder.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go index 7905c374c5..77daf9eda5 100644 --- a/src/cmd/compile/internal/noder/noder.go +++ b/src/cmd/compile/internal/noder/noder.go @@ -162,6 +162,7 @@ var allowedStdPragmas = map[string]bool{ "go:cgo_ldflag": true, "go:cgo_dynamic_linker": true, "go:embed": true, + "go:fix": true, "go:generate": true, } |
