Skip to content

Commit

Permalink
Merge pull request #35 from inovex/add-golangci-lint
Browse files Browse the repository at this point in the history
Add golangci lint
  • Loading branch information
arnisoph authored Jul 9, 2020
2 parents caa5cbc + f64aff5 commit 5ad0273
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
go-version: 1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Check out code
uses: actions/checkout@v2

- name: Go vet
run: go vet

- name: Build
run: make all

linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import (
)

var (
resultChan = make(chan Result)
stopWaitLoop = false
tearDownInProgress = false
randomSource = rand.New(rand.NewSource(time.Now().UnixNano()))
resultChan = make(chan Result)
stopWaitLoop = false
randomSource = rand.New(rand.NewSource(time.Now().UnixNano()))

subscriberClientIdTemplate = "mqtt-stresser-sub-%s-worker%d-%d"
publisherClientIdTemplate = "mqtt-stresser-pub-%s-worker%d-%d"
Expand Down Expand Up @@ -134,7 +133,7 @@ func main() {

actionTimeout, err := time.ParseDuration(*argTimeout)
if err != nil {
fmt.Fprintln(os.Stderr, "Could not parse '--timeout': '%s' is not a valid duration string. See https://golang.org/pkg/time/#ParseDuration for valid duration strings\n", *argGlobalTimeout)
fmt.Fprintf(os.Stderr, "Could not parse '--timeout': '%s' is not a valid duration string. See https://golang.org/pkg/time/#ParseDuration for valid duration strings\n", *argGlobalTimeout)
os.Exit(1)
}

Expand Down Expand Up @@ -269,7 +268,7 @@ func main() {
errorLogger.Println(msg)
}

if *argHideProgress == false {
if !*argHideProgress {
if msg.Event == CompletedEvent {
fmt.Print(".")
}
Expand Down
2 changes: 1 addition & 1 deletion report.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func buildHistogram(series []float64, total int) map[float64]float64 {
keys = append(keys, k)
}

sort.Sort(sort.Float64Slice(keys))
sort.Float64s(keys)
histogram := make(map[float64]float64)

prev := 0.0
Expand Down

0 comments on commit 5ad0273

Please sign in to comment.