Skip to content

Commit f20b5dc

Browse files
authored
chore: add support for mirror and makezero (#4060)
1 parent df8db66 commit f20b5dc

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ linters:
3131
- ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false]
3232
- intrange # intrange is a linter to find places where for loops could make use of an integer range. [fast: true, auto-fix: false]
3333
- loggercheck # (logrlint): Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). [fast: false, auto-fix: false]
34+
- makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false]
35+
- mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false]
3436
- misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
3537
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
3638
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]

internal/namespaces/autocomplete/autocomplete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func InstallCommandRun(ctx context.Context, argsI interface{}) (i interface{}, e
243243
}
244244

245245
// Append to file
246-
_, err = f.Write([]byte(autoCompleteScript + "\n"))
246+
_, err = f.WriteString(autoCompleteScript + "\n")
247247
if err != nil {
248248
return nil, err
249249
}

internal/namespaces/config/commands_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ profiles:
495495
send_telemetry: true
496496
`
497497

498-
if _, err := tmpFile.Write([]byte(configContent)); err != nil {
498+
if _, err := tmpFile.WriteString(configContent); err != nil {
499499
return nil, err
500500
}
501501
if err := tmpFile.Close(); err != nil {

internal/namespaces/registry/v1/helpers_docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func writeHelperScript(scriptPath string, scriptContent string) error {
3535
}
3636
defer f.Close()
3737

38-
_, err = f.Write([]byte(scriptContent))
38+
_, err = f.WriteString(scriptContent)
3939
if err != nil {
4040
return err
4141
}

0 commit comments

Comments
 (0)