Skip to content

Commit

Permalink
update os.IsNotExist to new idiomatic format
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Jun 24, 2022
1 parent d19176b commit 2bce7f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion logging/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ package logging

import (
"context"
"errors"
"io"
"io/fs"
"os"
)

Expand Down Expand Up @@ -215,7 +217,7 @@ func validatePaths(paths []string) []string {
continue
}

if f, err := os.Create(validatedPaths[i]); os.IsNotExist(err) {
if f, err := os.Create(validatedPaths[i]); errors.Is(err, fs.ErrNotExist) {
validatedPaths[i] = validatedPaths[len(validatedPaths)-1]
validatedPaths = validatedPaths[:len(validatedPaths)-1]
} else {
Expand Down

0 comments on commit 2bce7f2

Please sign in to comment.