mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
chore: update golangci-lint and fix all issues (#3575)
* chore: Update golangci-lint Signed-off-by: Lars Francke <git@lars-francke.de> * chore: fix all golangci-lint issues - Remove deprecated `// +build` tags - Fix godoclint, modernize, wsl_v5, govet, lll, gci, noctx issues - Update linter configuration - Modernize code to use Go 1.22+ features (for range N, slices.Contains, etc.) - Update make check lint the privileged tests Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> --------- Signed-off-by: Lars Francke <git@lars-francke.de> Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> Co-authored-by: Lars Francke <git@lars-francke.de>
This commit is contained in:
@@ -312,7 +312,7 @@ func (ib *BaseImageBuilder) EmptyLayer() ConfigBuilder {
|
||||
}
|
||||
|
||||
func (ib *BaseImageBuilder) RandomLayers(count, size int) ConfigBuilder {
|
||||
for i := 0; i < count; i++ {
|
||||
for range count {
|
||||
layer := make([]byte, size)
|
||||
|
||||
_, err := rand.Read(layer)
|
||||
|
||||
@@ -143,13 +143,14 @@ func GetDefaultVulnConfig() ispec.Image {
|
||||
}
|
||||
}
|
||||
|
||||
// RandomString generates a random string.
|
||||
// Adapted from https://gist.github.com/dopey/c69559607800d2f2f90b1b1ed4e550fb
|
||||
func RandomString(n int) string {
|
||||
const letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
|
||||
|
||||
ret := make([]byte, n)
|
||||
|
||||
for count := 0; count < n; count++ {
|
||||
for count := range n {
|
||||
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(letters))))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user