♻️ Use uint8 for Env
This commit is contained in:
parent
d7de194a90
commit
917f919401
6 changed files with 135 additions and 21 deletions
27
config/env_string.go
Normal file
27
config/env_string.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Code generated by "stringer -type Env"; DO NOT EDIT.
|
||||
|
||||
package config
|
||||
|
||||
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[Dev-1]
|
||||
_ = x[Prod-2]
|
||||
_ = x[Qa-3]
|
||||
_ = x[Test-4]
|
||||
}
|
||||
|
||||
const _Env_name = "DevProdQaTest"
|
||||
|
||||
var _Env_index = [...]uint8{0, 3, 7, 9, 13}
|
||||
|
||||
func (i Env) String() string {
|
||||
i -= 1
|
||||
if i >= Env(len(_Env_index)-1) {
|
||||
return "Env(" + strconv.FormatInt(int64(i+1), 10) + ")"
|
||||
}
|
||||
return _Env_name[_Env_index[i]:_Env_index[i+1]]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue