From deee1b75cf1d0dcb75eeab21b435f32bbbf3289f Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 6 May 2026 11:28:52 -0400 Subject: [PATCH] cmd/api/testdata: add test case for issue 79145 In this example, Tau is not deprecated, and Old is deprecated. The current cmd/api check produces false reports in both cases. The next CL fixes this. For #79145. Change-Id: I670fa01bb67d7ee58f1bcca9061494bd9b0105bf Reviewed-on: https://go-review.googlesource.com/c/go/+/774880 Reviewed-by: Alan Donovan TryBot-Bypass: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov --- src/cmd/api/testdata/src/pkg/issue79145/golden.txt | 5 +++++ .../api/testdata/src/pkg/issue79145/issue79145.go | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/cmd/api/testdata/src/pkg/issue79145/golden.txt create mode 100644 src/cmd/api/testdata/src/pkg/issue79145/issue79145.go diff --git a/src/cmd/api/testdata/src/pkg/issue79145/golden.txt b/src/cmd/api/testdata/src/pkg/issue79145/golden.txt new file mode 100644 index 0000000000..adb818ae0e --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/issue79145/golden.txt @@ -0,0 +1,5 @@ +pkg issue79145, const Tau //deprecated +pkg issue79145, const Tau = 6.28319 // 314159265358979323846264338327950288419716939937510582097494459/50000000000000000000000000000000000000000000000000000000000000 +pkg issue79145, const Tau ideal-float +pkg issue79145, const Old = true +pkg issue79145, const Old ideal-bool diff --git a/src/cmd/api/testdata/src/pkg/issue79145/issue79145.go b/src/cmd/api/testdata/src/pkg/issue79145/issue79145.go new file mode 100644 index 0000000000..bf6e5386e2 --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/issue79145/issue79145.go @@ -0,0 +1,14 @@ +package issue79145 + +// Tau is the constant τ, which equals to 6.283185... or 2π. Tau is not +// Deprecated: please find more information at https://oeis.org/A019692. +const Tau = 2 * pi + +const pi = 3.14159265358979323846264338327950288419716939937510582097494459 // https://oeis.org/A000796; like math.Pi + +/* +Old is something old. + +Deprecated: Use New instead. +*/ +const Old = true