Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miss makezero in slice init #1722

Closed
alingse opened this issue May 27, 2024 · 1 comment
Closed

miss makezero in slice init #1722

alingse opened this issue May 27, 2024 · 1 comment

Comments

@alingse
Copy link

alingse commented May 27, 2024

Database name

Wal-g provides support for many databases, please write down name of database you uses.

Issue description

Describe your problem

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

see issues alingse/go-linter-runner#1

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

====================================================================================================
append to slice `errMsgs` with non-zero initialized length at https://github.com/wal-g/wal-g/blob/master/internal/multistorage/storage.go#L114:13
====================================================================================================

the errMsgs := make([]string, len(ce.specificStorageErrs)) should be errMsgs := make([]string, 0, len(ce.specificStorageErrs))

Please provide steps to reproduce

// it can really help

Please add config and wal-g stdout/stderr logs for debug purpose

also you can use WALG_LOG_LEVEL=DEVEL for logs collecting

If you can, provide logs

```bash any logs here ```

@ostinru
Copy link
Contributor

ostinru commented May 28, 2024

makezero is supported by golang-ci, so we can add it our linters.
Also, there is similar linter prealloc linter (however authors notes that it is rarely impreove performance).

PS: also I'd like to add asciicheck linter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants