fix: fix slice init length
- fix - The PR contains a bug fix.
Description
The intention here should be to initialize a slice with a capacity of len(cdPipelines) rather than initializing the length of this slice.
The online demo: https://go.dev/play/p/vNUPNjdb2gJ
Fixes #
Checklist:
- [ ] The title of the PR states what changed and the related issues number (used for the release note).
- [ ] Does this PR requires documentation updates?
- [ ] I've updated documentation as required by this PR.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have tested it for all user roles.
- [ ] I have added all the required unit/api test cases.
Does this PR introduce a user-facing change?
Summary by Bito
- Fixes a bug in the slice initialization within the BuildPipelineRestHandler.go file, ensuring the slice is initialized with the correct capacity based on the length of cdPipelines, which prevents potential runtime errors related to slice operations.
- Improves memory efficiency by correctly initializing the slice.
- Overall summary: addresses a bug in slice initialization in BuildPipelineRestHandler.go, which fixes potential runtime errors.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
friendly ping~
Hi, Anything need I to do?
@vikramdevtron @abhibhaw Hi, Could you please review this PR at your convenience? Thank you very much.
️✅ There are no secrets present in this pull request anymore.
If these secrets were true positive and are still valid, we highly recommend you to revoke them. While these secrets were previously flagged, we no longer have a reference to the specific commits where they were detected. Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately. Find here more information about risks.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code