Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format: decl group allow first comment #214

Merged
merged 1 commit into from
Apr 3, 2022

Conversation

Oiyoo
Copy link
Collaborator

@Oiyoo Oiyoo commented Mar 21, 2022

fixes #212

@Oiyoo Oiyoo 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
)

@Oiyoo Oiyoo changed the title format: decl group allow first comment [WIP]format: decl group allow first comment Mar 21, 2022
@Oiyoo Oiyoo changed the title [WIP]format: decl group allow first comment format: decl group allow first comment Mar 30, 2022
@Oiyoo
Copy link
Collaborator Author

Oiyoo 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

@Oiyoo Oiyoo 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

format/format.go Outdated Show resolved Hide resolved
format/format.go Outdated Show resolved Hide resolved
format/format.go Show resolved Hide resolved
@Oiyoo Oiyoo 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