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

preserve placement of comment directives relative to variable declarations #126

Closed
buyology opened this issue May 17, 2021 · 1 comment
Closed

Comments

@buyology
Copy link

This package:

package p

import "embed"

//go:embed *
var fs embed.FS
var s string

gets gofumpted to

package p

import "embed"

//go:embed *
var (
	fs embed.FS
	s  string
)

which no longer compiles (./embed.go:5:3: misplaced go:embed directive) since the comment directive is moved above the variable group.

@mvdan
Copy link
Owner

mvdan commented May 17, 2021

Thanks, definitely sounds like a bug.

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

No branches or pull requests

2 participants