Struct tag of embedded types is not aligned with tags of surrounding struct fields.
What version of Go are you using (go version)?
$ go version
go version go1.17.8 darwin/amd64
Does this issue reproduce with the latest release?
Yes (1.17.8).
Also gotip on the Go Playground.
What did you do?
Apply gofmt to the following code.
type B string
type _ struct {
A string `json:"a"`
B `json:"b"`
C int `json:"c"`
D float32 `json:"d"`
}
Use the 'Format' button on the Go Playground.
What did you expect to see?
type _ struct {
A string `json:"a"`
B `json:"b"`
C int `json:"c"`
D float32 `json:"d"`
}
What did you see instead?
No change in formatting.
type _ struct {
A string `json:"a"`
B `json:"b"`
C int `json:"c"`
D float32 `json:"d"`
}
Struct tag of embedded types is not aligned with tags of surrounding struct fields.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes (1.17.8).
Also
gotipon the Go Playground.What did you do?
Apply
gofmtto the following code.Use the 'Format' button on the Go Playground.
What did you expect to see?
What did you see instead?
No change in formatting.