Skip to content

Commit 440e395

Browse files
committed
chore: remove bool
1 parent 6ad1bdc commit 440e395

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

getters.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ func newParsedFile(file *ast.File, fset *token.FileSet) (*parsedFile, error) {
4141
// with code and comment without reading the file. Function `Format`
4242
// from "go/format" won't help here if the original file is not gofmt-ed.
4343

44-
var filename string
45-
filename, _ = getFilename(fset, file)
44+
filename := getFilename(fset, file)
4645

4746
if !strings.HasSuffix(filename, ".go") {
4847
return nil, errEmptyInput
@@ -262,11 +261,11 @@ func matchAny(s string, rr []*regexp.Regexp) bool {
262261
return false
263262
}
264263

265-
func getFilename(fset *token.FileSet, file *ast.File) (string, bool) {
264+
func getFilename(fset *token.FileSet, file *ast.File) string {
266265
filename := fset.PositionFor(file.Pos(), true).Filename
267266
if !strings.HasSuffix(filename, ".go") {
268-
return fset.PositionFor(file.Pos(), false).Filename, false
267+
return fset.PositionFor(file.Pos(), false).Filename
269268
}
270269

271-
return filename, true
270+
return filename
272271
}

0 commit comments

Comments
 (0)