Skip to content

Commit

Permalink
Merge pull request #1547 from visualfc/cl_line
Browse files Browse the repository at this point in the history
cl: commentFunc skip nil filename
  • Loading branch information
xushiwei authored Nov 19, 2023
2 parents c8c8200 + deab96b commit 257c036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cl/stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func commentStmt(ctx *blockCtx, stmt ast.Stmt) {
}

func commentFunc(ctx *blockCtx, fn *gox.Func, decl *ast.FuncDecl) {
if ctx.fileLine {
start := decl.Name.Pos()
start := decl.Name.Pos()
if ctx.fileLine && start != token.NoPos {
pos := ctx.fset.Position(start)
if ctx.relativePath {
pos.Filename = relFile(ctx.targetDir, pos.Filename)
Expand Down

0 comments on commit 257c036

Please sign in to comment.