SpectoLabs / hoverfly

Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
https://hoverfly.io
Apache License 2.0
2.33k stars 204 forks source link

miss makezero in slice init #1131

Closed alingse closed 1 month ago

alingse commented 1 month ago

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/9243209781/job/25427055647

====================================================================================================
append to slice `indexes` with non-zero initialized length at https://github.com/SpectoLabs/hoverfly/blob/master/core/templating/templating.go#L160:14
====================================================================================================

the indexes := make([]JournalIndex, len(journal.Indexes)) should be indexes := make([]JournalIndex, 0, len(journal.Indexes))

kapishmalik commented 1 month ago

@alingse this is being fixed. Closing this issue.