Closed markus-oberhumer closed 6 years ago
This break compatibility
Git commit ef4e261f1f0f2198dbea63dfc6639910969ef297 broke the initialization of DefaultCondition.
So was this done on purpose?
What do you mean broke
?
FYI, Your commit change the type of DefaultCondition.
Well, after git commit ef4e261f1f0f2198dbea63dfc6639910969ef297 the value of DefaultCondition.EastAsianWidth is always false.
package main
import "fmt"
type Condition struct {
EastAsianWidth bool
}
var (
// EastAsianWidth will be set true if the current locale is CJK
EastAsianWidth bool
// DefaultCondition is a condition in current locale
DefaultCondition = &Condition{EastAsianWidth}
)
func init() {
EastAsianWidth = true // ASSUME true
}
func main() {
fmt.Printf("%v %v\n", EastAsianWidth, DefaultCondition.EastAsianWidth)
}
FYI, Your commit change the type of DefaultCondition.
Yes, just noticed that as well. But why is DefaultCondition a pointer in the first place?
Ok, I've updated the pull request so that the type of DefaultCondition is unchanged.
Please feel free to close this request if you think the current version is correct. Thanks!
Thank you. I noticed what you mean and this is my bug just now.
This is an oversight in git commit ef4e261f1f0f2198dbea63dfc6639910969ef297.