Composite literal uses unkeyed fields
enhancementgood first issue
Hi Patricio
I agree with the way you are doing the SDF function types as I was wrapping the SDFX functions to get the same effect. I am having a go at porting sdfx-ui to using sdf.
I am using go 1.18 and go vet complains about composite literal using unkeyed fields.
So I am testing adding
// New func to replace composite literal construction with unkeyed fields
func NewV2(x, y float64) r2.Vec {
return r2.Vec{X: x, Y: y}
}
to vector.gox`x
So the code changes (example of old and new):
v[1] = NewV2(a.Max.X, a.Min.Y) // br
v[2] = r2.Vec{a.Min.X, a.Max.Y} // tl
If you think it is a good idea I will try and create pull request when I am done.
关闭于 2024-08-12 6 条评论