dry icon indicating copy to clipboard operation
dry copied to clipboard

Bug Report: miss makezero in slice

Open alingse opened this issue 1 year ago • 0 comments
trafficstars

I was running github actions to run linter makezero for top github golang repos.

see issues https://github.com/alingse/go-linter-runner/issues/1

and the github actions output https://github.com/alingse/go-linter-runner/actions/runs/9243005739/job/25426568199

====================================================================================================
append to slice `tasks` with non-zero initialized length at https://github.com/moncho/dry/blob/master/mocks/docker_swarmDaemon.go#L71:11
====================================================================================================
	tasks := make([]swarm.Task, len(services))
	for _, service := range services {
		tasks = append(tasks, swarm.Task{ServiceID: service, NodeID: TestNodeID})
	}

	return tasks, nil

should be update to tasks := make([]swarm.Task, 0, len(services))

alingse avatar May 27 '24 14:05 alingse