From bc6cffde61d990484cefa6279fbd20fe1a94faec Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Mon, 1 Aug 2022 18:47:24 +0200 Subject: [PATCH] lint,decode,fuzz:: Fix nilerr warnings, one real one should be ignored for now --- format/fuzz_test.go | 2 +- pkg/interp/decode.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/format/fuzz_test.go b/format/fuzz_test.go index 837c0b45..f8d90200 100644 --- a/format/fuzz_test.go +++ b/format/fuzz_test.go @@ -82,7 +82,7 @@ func FuzzFormats(f *testing.F) { return nil } if st, err := os.Stat(path); err != nil || st.IsDir() { - return nil + return err } b, readErr := ioutil.ReadFile(path) diff --git a/pkg/interp/decode.go b/pkg/interp/decode.go index 6e7fe45f..5faa8283 100644 --- a/pkg/interp/decode.go +++ b/pkg/interp/decode.go @@ -258,6 +258,7 @@ func (i *Interp) _decode(c any, format string, opts decodeOpts) any { if len(opts.Remain) > 0 { if err := mapstruct.ToStruct(opts.Remain, &inArg); err != nil { // TODO: currently ignores failed struct mappings + //nolint: nilerr return f.DecodeInArg, nil } }