8000 GitHub Action to run golangci-lint on all pull requests (#95) · SelfCodeLearning/Go@f6f62d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6f62d1

Browse files
authored
GitHub Action to run golangci-lint on all pull requests (TheAlgorithms#95)
* Create go.yml * go get -v -t -d ./... || true * Create golangci-lint.yml * Install golangci-lint into ./bin/ * ./bin/golangci-lint run * ./bin/golangci-lint run --no-config * latest * v1.21.0 * go version * with: go-version: 1.13 * Update golangci-lint.yml * Delete go.yml * Update golangci-lint.yml * Update golangci-lint.yml * var positions []int = naivePatternSearch(text, pattern) * Update golangci-lint.yml * golangci-lint run --no-config ciphers strings
1 parent a30a499 commit f6f62d1

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://github.com/golangci/golangci-lint
2+
name: golangci-lint
3+
on: [push, pull_request]
4+
jobs:
5+
golangci-lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/setup-go@v1
9+
with:
10+
go-version: 1.13
11+
- uses: actions/checkout@v1
12+
- run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.21.0
13+
- run: |
14+
go version ; ./bin/golangci-lint --version
15+
./bin/golangci-lint run --no-config || true
16+
- run: ./bin/golangci-lint run --no-config ciphers strings
17+
- run: ./bin/golangci-lint run --no-config data-structures || true
18+
- run: ./bin/golangci-lint run --no-config dynamic-programming || true
19+
- run: ./bin/golangci-lint run --no-config other || true
20+
- run: ./bin/golangci-lint run --no-config searches || true
21+
- run: ./bin/golangci-lint run --no-config sorts || true

strings/naiveStringSearch.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ func naivePatternSearch(text string, pattern string) []int {
3434
func main() {
3535
text := "ABAAABCDBBABCDDEBCABC"
3636
pattern := "ABC"
37-
var positions []int
38-
positions = naivePatternSearch(text, pattern)
37+
var positions []int = naivePatternSearch(text, pattern)
3938
if len(positions) == 0 {
4039
fmt.Printf("Pattern not found in given text!")
4140
} else {

0 commit comments

Comments
 (0)
0