Skip to content

Commit

Permalink
fix: use filepath.Dir instead of path.Dir (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlipoca9 authored May 23, 2024
1 parent 38044e6 commit 5f29621
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reviser/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io"
"os"
"path"
"path/filepath"
"regexp"
"sort"
"strings"
Expand Down Expand Up @@ -438,7 +439,7 @@ func (f *SourceFile) parseImports(file *ast.File) (map[string]*commentsMetadata,

if shouldRemoveUnusedImports || shouldUseAliasForVersionSuffix {
var err error
packageImports, err = astutil.LoadPackageDependencies(path.Dir(f.filePath), astutil.ParseBuildTag(file))
packageImports, err = astutil.LoadPackageDependencies(filepath.Dir(f.filePath), astutil.ParseBuildTag(file))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 5f29621

Please sign in to comment.