Skip to content

format: decl group allow first comment#214

Merged
mvdan merged 1 commit intomvdan:masterfrom
tsnewaz:212-allow-first-comment
Apr 3, 2022
Merged

format: decl group allow first comment#214
mvdan merged 1 commit intomvdan:masterfrom
tsnewaz:212-allow-first-comment

Conversation

@tsnewaz
Copy link
Collaborator

@tsnewaz tsnewaz commented Mar 21, 2022

fixes #212

@tsnewaz tsnewaz requested a review from mvdan March 21, 2022 12:24
Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the comment was actually a directive, like:

//go:embed hello.txt
var embedded string
var foo int
var bar float

Presumably this would break the directive, but I haven't checked:

//go:embed hello.txt
var (
    embedded string
    foo int
    bar float
)

@tsnewaz tsnewaz changed the title format: decl group allow first comment [WIP]format: decl group allow first comment Mar 21, 2022
@tsnewaz tsnewaz force-pushed the 212-allow-first-comment branch from dad8329 to 6e1ed83 Compare March 30, 2022 18:08
@tsnewaz tsnewaz changed the title [WIP]format: decl group allow first comment format: decl group allow first comment Mar 30, 2022
@tsnewaz
Copy link
Collaborator Author

tsnewaz commented Mar 30, 2022

What if the comment was actually a directive, like:

//go:embed hello.txt
var embedded string
var foo int
var bar float

Presumably this would break the directive, but I haven't checked:

//go:embed hello.txt
var (
    embedded string
    foo int
    bar float
)

thanks, PTAL

@tsnewaz tsnewaz requested a review from mvdan March 30, 2022 18:10
Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests SGTM, just some thoughts about the code

@tsnewaz tsnewaz force-pushed the 212-allow-first-comment branch from 6e1ed83 to 51b71fc Compare April 3, 2022 05:25
@tsnewaz tsnewaz requested a review from mvdan April 3, 2022 05:29
Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mvdan mvdan merged commit a081d76 into mvdan:master Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Moving to one var block missed one variable

2 participants