You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*this is a description of the package*/package lib
funcSomeLongFuncNameToBreakLineLength() {
}
Then running golines with a length that ensure we do some formatting removes the newline between the closing */ and the package declaration:
$ golines --max-len=20 file.go /*this is a description of the package*/package libfunc SomeLongFuncNameToBreakLineLength() {}
If --max-len is not given, golines won't actually try and format anything and the the newline is preserved:
$ golines --max-len=20 file.go /*this is a description of the package*/package libfunc SomeLongFuncNameToBreakLineLength() {}
This appears to be related to an upstream issue in github.com/dave/dst/dave/dst#69 (but sharing here for visibility). Since golines bails early if there's nothing to format
in that case we don't call dst.{Parse/Printf} and hence the issue isn't triggered.
There's a fix for the issue upstream (dave/dst@5fa8d6e) but there's not been a new tag to include it. Testing that with go get github.com/dave/dst@5fa8d6ebe49a6b04afa15ee8f982d210f8a00b80 and I see the issue is resolved.
EDIT: upstream has created a new tag, here's a PR to include it #111
The text was updated successfully, but these errors were encountered:
Given the following file (
file.go
):Then running
golines
with a length that ensure we do some formatting removes the newline between the closing*/
and thepackage declaration
:If
--max-len
is not given,golines
won't actually try and format anything and the the newline is preserved:This appears to be related to an upstream issue in
github.com/dave/dst/
dave/dst#69 (but sharing here for visibility). Sincegolines
bails early if there's nothing to formatgolines/shortener.go
Line 114 in d7d11e6
dst.{Parse/Printf}
and hence the issue isn't triggered.There's a fix for the issue upstream (dave/dst@5fa8d6e) but there's not been a new tag to include it. Testing that with
go get github.com/dave/dst@5fa8d6ebe49a6b04afa15ee8f982d210f8a00b80
and I see the issue is resolved.EDIT: upstream has created a new tag, here's a PR to include it #111
The text was updated successfully, but these errors were encountered: