Skip to content

Commit 1fb8ebe

Browse files
authored
Merge pull request #902 from meshery/copilot/fix-golang-lint-checks
Fix golang lint failures: unchecked errors and disable ST1005 check
2 parents fa86a52 + 5eee5fa commit 1fb8ebe

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.golangci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
version: "2"
22

33
run:
4-
timeout: 5m
4+
timeout: 5m
5+
6+
linters-settings:
7+
staticcheck:
8+
go: "1.25"
9+
checks: ["all", "-ST1005"]
10+
11+
issues:
12+
exclude:
13+
- "ST1005"

generators/github/git_repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (gr GitRepo) GetContent() (models.Package, error) {
4141
filePath := filepath.Join(dirPath, utils.GetRandomAlphabetsOfDigit(5))
4242
fd, err := os.Create(filePath)
4343
if err != nil {
44-
os.RemoveAll(dirPath)
44+
_ = os.RemoveAll(dirPath)
4545
return nil, utils.ErrCreateFile(err, filePath)
4646
}
4747
br := bufio.NewWriter(fd)

models/registration/dir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func processDir(dirPath string, pkg *PackagingUnit, regErrStore RegistrationErro
6565
var tempDirs []string
6666
defer func() {
6767
for _, tempDir := range tempDirs {
68-
os.RemoveAll(tempDir)
68+
_ = os.RemoveAll(tempDir)
6969
}
7070
}()
7171

utils/component/generator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func TestGenerate(t *testing.T) {
154154
if got.Component.Kind != tt.want.Component.Kind {
155155
t.Errorf("got %v, want %v", got.Component.Kind, tt.want.Component.Kind)
156156
}
157-
if !(got.Component.Version == tt.want.Component.Version) {
157+
if got.Component.Version != tt.want.Component.Version {
158158
t.Errorf("got %v, want %v", got.Component.Version, tt.want.Component.Version)
159159
}
160160
})

0 commit comments

Comments
 (0)