From 6194601bba3eb49ce6111e08c7da39238f60de0a Mon Sep 17 00:00:00 2001 From: Siarhiej Siemianczuk Date: Wed, 18 Sep 2024 20:24:12 +0300 Subject: [PATCH] pkg/cbfs: fix error variable name Signed-off-by: Siarhiej Siemianczuk --- .golangci.yml | 2 +- pkg/cbfs/file.go | 4 ++-- pkg/cbfs/image.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index babcc79d..b97da830 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,4 +8,4 @@ linters-settings: staticcheck: checks: ["all", "-SA1019"] stylecheck: - checks: ["all", "-ST1003", "-ST1012"] + checks: ["all", "-ST1003"] diff --git a/pkg/cbfs/file.go b/pkg/cbfs/file.go index 25671688..02b92641 100644 --- a/pkg/cbfs/file.go +++ b/pkg/cbfs/file.go @@ -15,7 +15,7 @@ import ( "github.com/linuxboot/fiano/pkg/compression" ) -var CbfsHeaderMagicNotFound = errors.New("CBFS header magic doesn't match") +var ErrCBFSHeaderMagicNotFound = errors.New("CBFS header magic doesn't match") func (f *File) MarshalJSON() ([]byte, error) { return json.Marshal(mFile{ @@ -43,7 +43,7 @@ func NewFile(r io.ReadSeeker) (*File, error) { return nil, err } if string(f.Magic[:]) != FileMagic { - return nil, CbfsHeaderMagicNotFound + return nil, ErrCBFSHeaderMagicNotFound } Debug("Found CBFS file at %#02x is %v type %v", f.RecordStart, f, f.Type) diff --git a/pkg/cbfs/image.go b/pkg/cbfs/image.go index b407e4b7..7e6b8b51 100644 --- a/pkg/cbfs/image.go +++ b/pkg/cbfs/image.go @@ -64,7 +64,7 @@ func NewImage(rs io.ReadSeeker) (*Image, error) { return nil, err } f, err := NewFile(r) - if err == CbfsHeaderMagicNotFound { + if err == ErrCBFSHeaderMagicNotFound { off = off + 16 continue }