Skip to content

Commit

Permalink
format: add a TODO to remind myself about token.File.Lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Sep 25, 2023
1 parent 025a91f commit a8415d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions format/format.go
Expand Up @@ -217,6 +217,7 @@ func (f *fumpter) inlineComment(pos token.Pos) *ast.Comment {
func (f *fumpter) addNewline(at token.Pos) {
offset := f.Offset(at)

// TODO: replace with the new Lines method once we require Go 1.21 or later
field := reflect.ValueOf(f.File).Elem().FieldByName("lines")
n := field.Len()
lines := make([]int, 0, n+1)
Expand Down

0 comments on commit a8415d3

Please sign in to comment.