Enable unparam linter in golangci-lint
Fix the following linting errors and enable unparam
linter:
helpers/timeperiod/period_test.go:59:48: `testTimeperiodsWithTimezone` - `period` always receives `period` (`"* * 10-17 * * * *"`) (unparam)
func testTimeperiodsWithTimezone(t *testing.T, period, timezone string, month time.Month, day, hour, minute int, inPeriod bool) {
^
helpers/tls/ca_chain/resolver_url_test.go:18:21: `newFetcherMock` - `expectedURL` always receives `url1` (`"url1"`) (unparam)
func newFetcherMock(expectedURL string, data []byte, err error) fetcherMockFactory {
^
helpers/gitlab_ci_yaml_parser/parser.go:147:116: `(*GitLabCiYamlParser).buildDefaultVariables` - result `err` is always `nil` (unparam)
func (c *GitLabCiYamlParser) buildDefaultVariables(job *common.JobResponse) (defaultVariables common.JobVariables, err error) {
^
shells/abstract.go:289:101: `(*AbstractShell).writeRefspecFetchCmd` - `gitDir` is unused (unparam)
func (b *AbstractShell) writeRefspecFetchCmd(w ShellWriter, build *common.Build, projectDir string, gitDir string) {
^
shells/abstract.go:327:56: `(*AbstractShell).writeGitCleanup` - `build` is unused (unparam)
func (b *AbstractShell) writeGitCleanup(w ShellWriter, build *common.Build) {
^
shells/abstract_test.go:46:42: `getJobResponseWithMultipleArtifacts` - `t` is unused (unparam)
func getJobResponseWithMultipleArtifacts(t *testing.T) common.JobResponse {
^
executors/virtualbox/virtualbox.go:23:34: `(*executor).verifyMachine` - `vmName` is unused (unparam)
func (s *executor) verifyMachine(vmName string, sshPort string) error {
^
network/gitlab_test.go:1170:75: `testArtifactsDownloadHandler` - `t` is unused (unparam)
func testArtifactsDownloadHandler(w http.ResponseWriter, r *http.Request, t *testing.T) {
^
network/trace_test.go:38:60: `generateJobInfoMatcher` - `failureReason` always receives `common.NoneFailure` (`""`) (unparam)
func generateJobInfoMatcher(id int, state common.JobState, failureReason common.JobFailureReason) interface{} {
^
commands/helpers/artifacts_test.go:53:40: `(*testNetwork).consumeZipUpload` - `config` is unused (unparam)
func (m *testNetwork) consumeZipUpload(config common.JobCredentials, reader io.Reader, options common.ArtifactsOptions) common.UploadState {
^
commands/helpers/artifacts_test.go:71:41: `(*testNetwork).consumeGzipUpload` - `config` is unused (unparam)
func (m *testNetwork) consumeGzipUpload(config common.JobCredentials, reader io.Reader, options common.ArtifactsOptions) common.UploadState {
^
commands/helpers/artifacts_test.go:105:40: `(*testNetwork).consumeRawUpload` - `config` is unused (unparam)
func (m *testNetwork) consumeRawUpload(config common.JobCredentials, reader io.Reader, options common.ArtifactsOptions) common.UploadState {
^
executors/docker/machine/provider_test.go:199:100: assertIdleMachines - result 0 (bool) is never used (unparam)
func assertIdleMachines(t *testing.T, p *machineProvider, expected int, msgAndArgs ...interface{}) bool {
^
executors/docker/machine/provider_test.go:228:101: assertTotalMachines - result 0 (bool) is never used (unparam)
func assertTotalMachines(t *testing.T, p *machineProvider, expected int, msgAndArgs ...interface{}) bool {
^
executors/docker/docker_test.go:46:28: `buildImagePullOptions` - `e` is unused (unparam)
func buildImagePullOptions(e *executor, configName string) mock.AnythingOfTypeArgument {
^
executors/docker/docker_test.go:1147:24: `getTestAuthConfig` - `t` is unused (unparam)
func getTestAuthConfig(t *testing.T, e *executor, imageName string) *types.AuthConfig {
^
commands/exec.go:30:34: `(*ExecCommand).runCommand` - `name` always receives `"git"` (unparam)
func (c *ExecCommand) runCommand(name string, arg ...string) (string, error) {
^
commands/service.go:57:62: runServiceStatus - result 0 (error) is always nil (unparam)
func runServiceStatus(displayName string, s service.Service) error {
^
commands/service_test.go:23:28: `testServiceCommandRun` - `t` is unused (unparam)
func testServiceCommandRun(t *testing.T, command func(*cli.Context), args ...string) {
^
executors/kubernetes/terminal.go:78:44: `(*executor).getTerminalWebSocketURL` - `config` is unused (unparam)
func (s *executor) getTerminalWebSocketURL(config *restclient.Config) (*url.URL, error) {
^
executors/kubernetes/util.go:210:52: limits - result 1 (error) is always nil (unparam)
func limits(cpu, memory string) (api.ResourceList, error) {
^
make: *** [codequality] Error 1
Edited by Pedro Pombeiro