Skip to content

Commit

Permalink
GitHub Action to run golangci-lint on all pull requests (TheAlgorithm…
Browse files Browse the repository at this point in the history
…s#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
  • Loading branch information
cclauss authored Nov 28, 2019
1 parent a30a499 commit f6f62d1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://github.com/golangci/golangci-lint
name: golangci-lint
on: [push, pull_request]
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
- uses: actions/checkout@v1
- run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.21.0
- run: |
go version ; ./bin/golangci-lint --version
./bin/golangci-lint run --no-config || true
- run: ./bin/golangci-lint run --no-config ciphers strings
- run: ./bin/golangci-lint run --no-config data-structures || true
- run: ./bin/golangci-lint run --no-config dynamic-programming || true
- run: ./bin/golangci-lint run --no-config other || true
- run: ./bin/golangci-lint run --no-config searches || true
- run: ./bin/golangci-lint run --no-config sorts || true
3 changes: 1 addition & 2 deletions strings/naiveStringSearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ func naivePatternSearch(text string, pattern string) []int {
func main() {
text := "ABAAABCDBBABCDDEBCABC"
pattern := "ABC"
var positions []int
positions = naivePatternSearch(text, pattern)
var positions []int = naivePatternSearch(text, pattern)
if len(positions) == 0 {
fmt.Printf("Pattern not found in given text!")
} else {
Expand Down

0 comments on commit f6f62d1

Please sign in to comment.