Skip to content

Commit

Permalink
Fix line break removal before package directive
Browse files Browse the repository at this point in the history
Due to an upstream bug[1] if `golines` were to reformat (i.e. it
actually found a line that was too long) a file with a block comment
before the package directive, the newline before the package directive
would be stripped, e.g.

    /*
    this is a comment
    */
    package foo

Would become

    /*
    this is a comment
    */ package foo

The underlying issue has been fixed upstream, so fix here by bumping the
version of `github.com/dave/dst` to include that fix. Here's a summary of
the changes in that package from the previously used version:

    $ git log --no-merges --format='%h %s' v0.27.0..v0.27.3
    5fa8d6e Fixes segmentio#69
    bc71a76 Upgrade golang.org/x/tools to v0.1.12
    b6f3447 decorator: make an error more verbose

[1] dave/dst#69
  • Loading branch information
matthewhughes934 committed Oct 8, 2024
1 parent 13c3f0d commit ac81bd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _fixtures/doc_comment_block.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
This is a long package comment. It contains nothing interesting but is longer than the default line limit
*/
package fixtures
4 changes: 4 additions & 0 deletions _fixtures/doc_comment_block__exp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
This is a long package comment. It contains nothing interesting but is longer than the default line limit
*/
package fixtures

0 comments on commit ac81bd6

Please sign in to comment.