Skip to content

Commit 45a4873

Browse files
committed
fix deprecation comment for (FlagSet.)ParseErrorsWhitelist
Commit 7412009 added back these types and marked them as deprecated, but did not use the correct format as documented in the [go documentation]. Deprecation comments should be in their own paragraph within the GoDoc, and start with `Deprecated:`, which is case-sensitive. Currently, the deprecation comment is not properly detected, and does not show up as deprecated on [pkg.go.dev]. This patch; - Fixes the deprecation comments to be in the right format. - Updates the GoDoc to use a "docs link" to refer to their replacement, which creates a link to those types on pkg.go.dev. - Adds back GoDoc for the deprecated functions to make sure the GoDoc is in the correct format and keep linters happy. [go documentation]: https://go.dev/doc/comment#deprecations [pkg.go.dev]: https://pkg.go.dev/github.com/spf13/[email protected]#ParseErrorsWhitelist Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 1043857 commit 45a4873

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

flag.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ type ParseErrorsAllowlist struct {
143143
UnknownFlags bool
144144
}
145145

146-
// DEPRECATED: please use ParseErrorsAllowlist instead
147-
// This type will be removed in a future release
146+
// ParseErrorsWhitelist defines the parsing errors that can be ignored.
147+
//
148+
// Deprecated: use [ParseErrorsAllowlist] instead. This type will be removed in a future release.
148149
type ParseErrorsWhitelist = ParseErrorsAllowlist
149150

150151
// NormalizedName is a flag name that has been normalized according to rules
@@ -165,8 +166,9 @@ type FlagSet struct {
165166
// ParseErrorsAllowlist is used to configure an allowlist of errors
166167
ParseErrorsAllowlist ParseErrorsAllowlist
167168

168-
// DEPRECATED: please use ParseErrorsAllowlist instead
169-
// This field will be removed in a future release
169+
// ParseErrorsAllowlist is used to configure an allowlist of errors.
170+
//
171+
// Deprecated: use [FlagSet.ParseErrorsAllowlist] instead. This field will be removed in a future release.
170172
ParseErrorsWhitelist ParseErrorsAllowlist
171173

172174
name string

0 commit comments

Comments
 (0)