goformat
goformat copied to clipboard
goformat does not understand template arguments
func BoolToNumber[T T_Number](v bool) T { if v { return T(1) } return T(0) }
when run goformat commant, it will be changed to:
func BoolToNumber(v bool) T { if v { return T(1) } return T(0) }
That's because goformat doesn't know anything about this syntax because it was added after the last sync with upstream gofmt. I haven't used Go in years, so I'm not going to do this sync anytime soon. Maybe you want to try it. There is a script get-upstream-changes that helps with this.