Skip to content

Commit 349926d

Browse files
schuellerfmvo5
authored andcommitted
bib: fix linter problems
New linter problems arose after updating golangci-lint's version.
1 parent 70637cf commit 349926d

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

bib/cmd/bootc-image-builder/cloud.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func upload(uploader cloud.Uploader, path string, flags *pflag.FlagSet) error {
2929
if err != nil {
3030
return fmt.Errorf("cannot upload: %v", err)
3131
}
32+
// nolint:errcheck
3233
defer file.Close()
3334

3435
var r io.Reader = file

bib/cmd/bootc-image-builder/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func checkMountpoints(filesystems []blueprint.FilesystemCustomization, policy *p
126126
}
127127
}
128128
if len(errs) > 0 {
129-
return fmt.Errorf("The following errors occurred while validating custom mountpoints:\n%w", errors.Join(errs...))
129+
return fmt.Errorf("the following errors occurred while validating custom mountpoints:\n%w", errors.Join(errs...))
130130
}
131131
return nil
132132
}

bib/cmd/bootc-image-builder/image_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,31 +108,31 @@ func TestCheckFilesystemCustomizationsValidates(t *testing.T) {
108108
{Mountpoint: "/ostree"},
109109
},
110110
ptmode: disk.RawPartitioningMode,
111-
expectedErr: "The following errors occurred while validating custom mountpoints:\npath \"/ostree\" is not allowed",
111+
expectedErr: "the following errors occurred while validating custom mountpoints:\npath \"/ostree\" is not allowed",
112112
},
113113
{
114114
fsCust: []blueprint.FilesystemCustomization{
115115
{Mountpoint: "/"},
116116
{Mountpoint: "/var"},
117117
},
118118
ptmode: disk.RawPartitioningMode,
119-
expectedErr: "The following errors occurred while validating custom mountpoints:\npath \"/var\" is not allowed",
119+
expectedErr: "the following errors occurred while validating custom mountpoints:\npath \"/var\" is not allowed",
120120
},
121121
{
122122
fsCust: []blueprint.FilesystemCustomization{
123123
{Mountpoint: "/"},
124124
{Mountpoint: "/var/data"},
125125
},
126126
ptmode: disk.BtrfsPartitioningMode,
127-
expectedErr: "The following errors occurred while validating custom mountpoints:\npath \"/var/data\" is not allowed",
127+
expectedErr: "the following errors occurred while validating custom mountpoints:\npath \"/var/data\" is not allowed",
128128
},
129129
{
130130
fsCust: []blueprint.FilesystemCustomization{
131131
{Mountpoint: "/"},
132132
{Mountpoint: "/boot/"},
133133
},
134134
ptmode: disk.BtrfsPartitioningMode,
135-
expectedErr: "The following errors occurred while validating custom mountpoints:\npath \"/boot/\" must be canonical",
135+
expectedErr: "the following errors occurred while validating custom mountpoints:\npath \"/boot/\" must be canonical",
136136
},
137137
{
138138
fsCust: []blueprint.FilesystemCustomization{
@@ -141,7 +141,7 @@ func TestCheckFilesystemCustomizationsValidates(t *testing.T) {
141141
{Mountpoint: "/opt"},
142142
},
143143
ptmode: disk.BtrfsPartitioningMode,
144-
expectedErr: "The following errors occurred while validating custom mountpoints:\npath \"/boot/\" must be canonical\npath \"/opt\" is not allowed",
144+
expectedErr: "the following errors occurred while validating custom mountpoints:\npath \"/boot/\" must be canonical\npath \"/opt\" is not allowed",
145145
},
146146
} {
147147
if tc.expectedErr == "" {

bib/cmd/bootc-image-builder/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func saveManifest(ms manifest.OSBuildManifest, fpath string) error {
176176
if err != nil {
177177
return fmt.Errorf("failed to create output file %q: %s", fpath, err.Error())
178178
}
179+
// nolint:errcheck
179180
defer fp.Close()
180181
if _, err := fp.Write(b); err != nil {
181182
return fmt.Errorf("failed to write output file %q: %s", fpath, err.Error())

bib/cmd/upload/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func uploadAMI(cmd *cobra.Command, args []string) {
4040

4141
f, err := os.Open(filename)
4242
check(err)
43+
// nolint:errcheck
4344
defer f.Close()
4445

4546
check(uploader.UploadAndRegister(f, os.Stderr))

bib/internal/buildconfig/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func loadConfig(path string) (*externalBlueprint.Blueprint, error) {
8787
if err != nil {
8888
return nil, err
8989
}
90+
// nolint:errcheck
9091
defer fp.Close()
9192
}
9293

bib/internal/buildconfig/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ func TestReadWithFallbackFromStdin(t *testing.T) {
184184
fakeUserCnfPath := makeFakeConfig(t, "fake-stdin", fakeConfigJSON)
185185
fakeStdinFp, err := os.Open(fakeUserCnfPath)
186186
require.NoError(t, err)
187+
// nolint:errcheck
187188
defer fakeStdinFp.Close()
188189

189190
restore := buildconfig.MockOsStdin(fakeStdinFp)

0 commit comments

Comments
 (0)