Skip to content

Commit c4cf9a4

Browse files
committed
fix: add dual lint directives for deprecated toml API
Use both //nolint:staticcheck (golangci-lint) and //lint:ignore SA1019 (standalone staticcheck) since each tool only respects its own directive format.
1 parent 501e024 commit c4cf9a4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/filter/toml_filter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ func LoadTOMLFilterFile(path string) (*TOMLFilterFile, error) {
112112
return nil, fmt.Errorf("toml_filter: decode %s: %w", path, err)
113113
}
114114
if v, ok := raw["schema_version"]; ok {
115+
//nolint:staticcheck // SA1019: PrimitiveDecode deprecated but needed for this decode flow
115116
//lint:ignore SA1019 PrimitiveDecode is deprecated but MetaData.PrimitiveDecode requires a different decode flow
116117
_ = toml.PrimitiveDecode(v, &f.Schema)
117118
delete(raw, "schema_version")
118119
}
119120
for name, prim := range raw {
120121
cfg := &TOMLFilterConfig{Name: name}
122+
//nolint:staticcheck // SA1019: PrimitiveDecode deprecated but needed for this decode flow
121123
//lint:ignore SA1019 PrimitiveDecode is deprecated but MetaData.PrimitiveDecode requires a different decode flow
122124
if err := toml.PrimitiveDecode(prim, cfg); err != nil {
123125
return nil, fmt.Errorf("toml_filter: decode section [%s] in %s: %w", name, path, err)

0 commit comments

Comments
 (0)