]> Cypherpunks repositories - gostls13.git/commit
std: add //go:fix inline directives to some deprecated functions
authorAlan Donovan <adonovan@google.com>
Wed, 12 Feb 2025 16:18:30 +0000 (11:18 -0500)
committerGopher Robot <gobot@golang.org>
Sat, 15 Feb 2025 16:06:58 +0000 (08:06 -0800)
commit586e205522279406a9fcd2ab6cd1a1f416f1eae4
tree3481a94a78e2a2af045b4b5873329a492da9161b
parentbeac2f7d3b72ecaff146b98afb690489f0192422
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>
src/cmd/compile/internal/noder/noder.go
src/go/importer/importer.go
src/go/types/signature.go
src/io/ioutil/ioutil.go
src/io/ioutil/tempfile.go
src/reflect/type.go