chore: add string conversion
This commit is contained in:
parent
ebf514bb78
commit
7c9c21118e
2 changed files with 14 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by "enumer -type Method"; DO NOT EDIT.
|
||||
// Code generated by "enumer -type Method -text"; DO NOT EDIT.
|
||||
|
||||
package plugin
|
||||
|
||||
|
|
@ -81,3 +81,15 @@ func (i Method) IsAMethod() bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// MarshalText implements the encoding.TextMarshaler interface for Method
|
||||
func (i Method) MarshalText() ([]byte, error) {
|
||||
return []byte(i.String()), nil
|
||||
}
|
||||
|
||||
// UnmarshalText implements the encoding.TextUnmarshaler interface for Method
|
||||
func (i *Method) UnmarshalText(text []byte) error {
|
||||
var err error
|
||||
*i, err = MethodString(string(text))
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue