Skip to content

Commit

Permalink
Fix nolint issues
Browse files Browse the repository at this point in the history
Reference -> https://golangci-lint.run/usage/false-positives/#nolint-directive

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
  • Loading branch information
ulyssessouza committed Jul 13, 2022
1 parent 2e30acb commit 621de48
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dotenv/godotenv.go
Expand Up @@ -183,7 +183,7 @@ func Marshal(envMap map[string]string) (string, error) {
if d, err := strconv.Atoi(v); err == nil {
lines = append(lines, fmt.Sprintf(`%s=%d`, k, d))
} else {
lines = append(lines, fmt.Sprintf(`%s="%s"`, k, doubleQuoteEscape(v))) // nolint Cannot use %q here
lines = append(lines, fmt.Sprintf(`%s="%s"`, k, doubleQuoteEscape(v))) //nolint // Cannot use %q here
}
}
sort.Strings(lines)
Expand Down
2 changes: 1 addition & 1 deletion loader/loader.go
Expand Up @@ -637,7 +637,7 @@ func resolveEnvironment(serviceConfig *types.ServiceConfig, workingDir string, l
}

// Do not defer to avoid it inside a loop
file.Close() // nolint:errcheck
file.Close() //nolint:errcheck

fileVars, err := dotenv.ParseWithLookup(bytes.NewBuffer(b), dotenv.LookupFn(lookupEnv))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions loader/merge.go
Expand Up @@ -299,15 +299,15 @@ func mergeLoggingConfig(dst, src reflect.Value) error {
return nil
}

// nolint: unparam
//nolint: unparam
func mergeUlimitsConfig(dst, src reflect.Value) error {
if src.Interface() != reflect.Zero(reflect.TypeOf(src.Interface())).Interface() {
dst.Elem().Set(src.Elem())
}
return nil
}

// nolint: unparam
//nolint: unparam
func mergeServiceNetworkConfig(dst, src reflect.Value) error {
if src.Interface() != reflect.Zero(reflect.TypeOf(src.Interface())).Interface() {
dst.Elem().FieldByName("Aliases").Set(src.Elem().FieldByName("Aliases"))
Expand Down
2 changes: 1 addition & 1 deletion loader/windows_path.go
Expand Up @@ -44,7 +44,7 @@ func isAbs(path string) (b bool) {

// volumeNameLen returns length of the leading volume name on Windows.
// It returns 0 elsewhere.
// nolint: gocyclo
//nolint: gocyclo
func volumeNameLen(path string) int {
if len(path) < 2 {
return 0
Expand Down

0 comments on commit 621de48

Please sign in to comment.