You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attached example leads to code that does not build. (Go 1.9 on my machine, but almost certainly on all release versions of Go.)
package ffjsonbug
type Foo struct {
Bar []struct{}
}
Here is the relevant section of generated code:
if j.Bar != nil {
buf.WriteString(`[`)
for i, v := range j.Bar {
if i != 0 {
buf.WriteString(`,`)
}
/* Inline struct. type=struct {} kind=struct */
buf.WriteString(`{}`)
}
buf.WriteString(`]`)
} else {
buf.WriteString(`null`)
}
The special case for struct{} causes v to be un-used.
The text was updated successfully, but these errors were encountered:
The attached example leads to code that does not build. (Go 1.9 on my machine, but almost certainly on all release versions of Go.)
Here is the relevant section of generated code:
The special case for
struct{}
causesv
to be un-used.The text was updated successfully, but these errors were encountered: