Skip to content

Commit

Permalink
get dir with package filepath (#125)
Browse files Browse the repository at this point in the history
Co-authored-by: Vyacheslav Pryimak <vyacheslavpryimak@gmail.com>
  • Loading branch information
meiping and incu6us committed Aug 26, 2023
1 parent 91b69df commit 25a6861
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 @@ -460,7 +461,7 @@ func (f *SourceFile) parseImports(file *ast.File) (map[string]*commentsMetadata,
var err error

if shouldRemoveUnusedImports || shouldUseAliasForVersionSuffix {
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 25a6861

Please sign in to comment.