Skip to content

Commit 2790da5

Browse files
authored
chore: Enable govet linter with all checks (#3935)
1 parent 2936e40 commit 2790da5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ linters:
1515
- godot
1616
- goheader
1717
- gosec
18+
- govet
1819
- intrange
1920
- misspell
2021
- modernize
@@ -65,6 +66,11 @@ linters:
6566
- G104
6667
# int(os.Stdin.Fd())
6768
- G115
69+
govet:
70+
enable-all: true
71+
disable:
72+
- fieldalignment
73+
- shadow
6874
misspell:
6975
locale: US
7076
# extra words from https://go.dev//wiki/Spelling

test/integration/activity_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ func TestActivity_Watching(t *testing.T) {
125125
t.Fatalf("Activity.GetRepositorySubscription returned error: %v", err)
126126
}
127127

128-
switch {
129-
case sub != nil: // If already subscribing, delete then recreate subscription.
128+
if sub != nil { // If already subscribing, delete then recreate subscription.
130129
deleteSubscription(t)
131130
createSubscription(t)
132-
case sub == nil: // Otherwise, create subscription and then delete it.
131+
} else { // Otherwise, create subscription and then delete it.
133132
createSubscription(t)
134133
deleteSubscription(t)
135134
}

test/integration/repos_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestRepositories_CRUD(t *testing.T) {
4040
if err == nil {
4141
t.Fatal("Test repository still exists after deleting it.")
4242
}
43-
if err != nil && resp.StatusCode != http.StatusNotFound {
43+
if resp.StatusCode != http.StatusNotFound {
4444
t.Fatalf("Repositories.Get() returned error: %v", err)
4545
}
4646
}

0 commit comments

Comments
 (0)