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
Go1.12 CL https://golang.org/cl/131495 will break this package's use of upper() and lower() calls. This is exhibited in the following test failure ...
$ go version
go version go1.12beta1 linux/386
$ go test
--- FAIL: TestToGoName (0.03s)
util_test.go:66:
Error Trace: util_test.go:66
Error: Not equal:
expected: "X日本語sample2Text"
actual : "X�\xbf\xbd��本語sample2Text"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-X日本語sample2Text
+X�����本語sample2Text
Test: TestToGoName
util_test.go:66:
Error Trace: util_test.go:66
Error: Not equal:
expected: "X日本語findThingByID"
actual : "X�\xbf\xbd��本語findThingByID"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-X日本語findThingByID
+X�����本語findThingByID
Test: TestToGoName
FAIL
exit status 1
The issue has to do with this package passing in str[:1] to upper() and lower() assuming that slicing out the first byte is a valid unicode character and if not, the calls to strings.ToUpper or strings.ToLower will return back the same byte and hence can be reused. The new behavior of strings.ToUpper and strings.ToLower returns back utf8.RuneError if byte is not a valid unicode character instead and breaks the logic in callers when concatenating to another string slice.
Go1.12 CL https://golang.org/cl/131495 will break this package's use of upper() and lower() calls. This is exhibited in the following test failure ...
The issue has to do with this package passing in str[:1] to upper() and lower() assuming that slicing out the first byte is a valid unicode character and if not, the calls to strings.ToUpper or strings.ToLower will return back the same byte and hence can be reused. The new behavior of strings.ToUpper and strings.ToLower returns back utf8.RuneError if byte is not a valid unicode character instead and breaks the logic in callers when concatenating to another string slice.
For example -- https://github.com/go-openapi/swag/blob/v0.18.0/util.go#L332-L337.
The text was updated successfully, but these errors were encountered: