Skip to content

Commit 4925b41

Browse files
authored
Upgrade golangci/golangci-lint-action@v2 (#222)
* Upgrade golangci/golangci-lint-action@v2 * actions/setup-go@v2 * Update golangci-lint.yml * Update golangci-lint.yml * Update golangci-lint.yml * Update golangci-lint.yml * Update golangci-lint.yml * gosimple change * gosimple change * Update golangci-lint.yml
1 parent 28bdc6c commit 4925b41

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@ jobs:
88
fail-fast: false
99
steps:
1010
- uses: actions/checkout@v2
11-
- name: golangci-lint
12-
uses: golangci/golangci-lint-action@v1
11+
- uses: actions/setup-go@v2
12+
- uses: golangci/golangci-lint-action@v2
1313
with:
1414
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
15-
version: v1.27
16-
working-directory: sorts
15+
version: v1.31
1716
args: --issues-exit-code=0 # Hopefully someday we can remove this...
18-
# Only show new issues if this is a pull request...
19-
# only-new-issues: true
20-
- run: echo "::set-env name=PATH::/home/runner/golangci-lint-1.27.0-linux-amd64:$PATH"
17+
working-directory: sorts # Hopefully someday we can remove this... and enable only-new-issues
18+
# only-new-issues: true # Let's focus on this PR first
19+
- run: echo "/home/runner/golangci-lint-1.31.0-linux-amd64" >> $GITHUB_PATH
2120
- run: go version ; golangci-lint --version # Fix the following and remove || true
22-
- run: golangci-lint run --no-config ciphers || true
21+
- run: golangci-lint run --no-config ciphers
2322
- run: golangci-lint run --no-config data-structures/binary-tree || true
2423
- run: golangci-lint run --no-config data-structures/dynamic-array || true
25-
- run: golangci-lint run --no-config data-structures/hash-map || true
24+
- run: golangci-lint run --no-config data-structures/hash-map
2625
- run: golangci-lint run --no-config data-structures/linked-list || true
2726
- run: golangci-lint run --no-config data-structures/trie || true
2827
- run: golangci-lint run --no-config dynamic-programming || true

data-structures/hash-map/hash_map.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ func (hm *HashMap) Put(key interface{}, value interface{}) interface{} {
4747
// Contains checks if given key is stored in hashmap
4848
func (hm *HashMap) Contains(key interface{}) bool {
4949
node := hm.getNodeByHash(hm.hash(key))
50-
51-
if node != nil {
52-
return true
53-
}
54-
55-
return false
50+
return node != nil
5651
}
5752

5853
func (hm *HashMap) putValue(hash uint64, key interface{}, value interface{}) interface{} {

math/sieve/Sieve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func nextF(f int, r chan int, nums []bool) {
4242
for {
4343
<-r
4444
for i, v := range nums[f:] {
45-
if v == true {
45+
if v {
4646
r <- i + f
4747
}
4848
}

0 commit comments

Comments
 (0)