alexei-led / pumba

Chaos testing, network emulation, and stress testing tool for containers
Apache License 2.0
2.75k stars 193 forks source link

Multiple issues raised by golangci-lint #222

Closed aminvakil closed 1 year ago

aminvakil commented 1 year ago

I'm using https://github.com/golangci/golangci-lint to package pumba and since its latest release (v1.50.1) two days ago, tests fail on this project.

pkg/util/util.go:45:49: directive `//nolint:gomnd` is unused for linter "gomnd" (nolintlint)
        portNum, err := strconv.ParseInt(port, 10, 64) //nolint:gomnd
                                                       ^
pkg/chaos/netem/corrupt.go:96:78: directive `//nolint:gomnd` is unused for linter "gomnd" (nolintlint)
        netemCmd := []string{"corrupt", strconv.FormatFloat(n.percent, 'f', 2, 64)} //nolint:gomnd
                                                                                    ^
pkg/chaos/netem/corrupt.go:98:79: directive `//nolint:gomnd` is unused for linter "gomnd" (nolintlint)
                netemCmd = append(netemCmd, strconv.FormatFloat(n.correlation, 'f', 2, 64)) //nolint:gomnd
                                                                                            ^
alexei-led commented 1 year ago

agree, need to replace with const

aminvakil commented 1 year ago

@alexei-led Thanks, do you think this would result in a new release too?

alexei-led commented 1 year ago

fixed