chore: generate (un)marshalers
This commit is contained in:
parent
6446d920e9
commit
48666a59c6
5 changed files with 31 additions and 32 deletions
|
|
@ -2,15 +2,7 @@ package api
|
|||
|
||||
type Feature int
|
||||
|
||||
func (f *Feature) UnmarshalText(text []byte) error {
|
||||
feat, err := FeatureString(string(text))
|
||||
if err == nil {
|
||||
*f = feat
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
//go:generate enumer -type Feature
|
||||
//go:generate enumer -type Feature -text
|
||||
const (
|
||||
_ Feature = iota
|
||||
Offline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue