mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
client/entities: stringfy const type LoginError (#300)
This commit is contained in:
parent
b291cf2896
commit
64722799b7
@ -296,6 +296,7 @@ type (
|
||||
unit = struct{}
|
||||
)
|
||||
|
||||
//go:generate stringer -type=LoginError
|
||||
const (
|
||||
NeedCaptcha LoginError = 1
|
||||
OtherLoginError LoginError = 3
|
||||
|
43
client/loginerror_string.go
Normal file
43
client/loginerror_string.go
Normal file
@ -0,0 +1,43 @@
|
||||
// Code generated by "stringer -type=LoginError"; DO NOT EDIT.
|
||||
|
||||
package client
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[NeedCaptcha-1]
|
||||
_ = x[OtherLoginError-3]
|
||||
_ = x[UnsafeDeviceError-4]
|
||||
_ = x[SMSNeededError-5]
|
||||
_ = x[TooManySMSRequestError-6]
|
||||
_ = x[SMSOrVerifyNeededError-7]
|
||||
_ = x[SliderNeededError-8]
|
||||
_ = x[UnknownLoginError - -1]
|
||||
}
|
||||
|
||||
const (
|
||||
_LoginError_name_0 = "UnknownLoginError"
|
||||
_LoginError_name_1 = "NeedCaptcha"
|
||||
_LoginError_name_2 = "OtherLoginErrorUnsafeDeviceErrorSMSNeededErrorTooManySMSRequestErrorSMSOrVerifyNeededErrorSliderNeededError"
|
||||
)
|
||||
|
||||
var (
|
||||
_LoginError_index_2 = [...]uint8{0, 15, 32, 46, 68, 90, 107}
|
||||
)
|
||||
|
||||
func (i LoginError) String() string {
|
||||
switch {
|
||||
case i == -1:
|
||||
return _LoginError_name_0
|
||||
case i == 1:
|
||||
return _LoginError_name_1
|
||||
case 3 <= i && i <= 8:
|
||||
i -= 3
|
||||
return _LoginError_name_2[_LoginError_index_2[i]:_LoginError_index_2[i+1]]
|
||||
default:
|
||||
return "LoginError(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user