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

Breaks import comment #289

Open
AlexanderYastrebov opened this issue Dec 9, 2023 · 1 comment
Open

Breaks import comment #289

AlexanderYastrebov opened this issue Dec 9, 2023 · 1 comment

Comments

@AlexanderYastrebov
Copy link

I've noticed this while playing with formatting go sources

gofumpt -d ./net/dnsclient.go
diff ./net/dnsclient.go.orig ./net/dnsclient.go
--- ./net/dnsclient.go.orig
+++ ./net/dnsclient.go
@@ -5,15 +5,19 @@
 package net
 
 import (
+       "sort"
+       _ "unsafe"
+
        "internal/bytealg"
        "internal/itoa"
-       "sort"
-       _ "unsafe" // for go:linkname
+
+       // for go:linkname
 
        "golang.org/x/net/dns/dnsmessage"
 )
 
 // provided by runtime
+//
 //go:linkname runtime_rand runtime.rand
 func runtime_rand() uint64
@mvdan
Copy link
Owner

mvdan commented Jan 28, 2024

Yep, for better or worse, this is how comments in Go work at the moment. Reordering or moving imports is also a bit broken right now, e.g. see #225. The handling of import declarations needs a bit of a rethink.

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