chore: add string conversion

This commit is contained in:
andig 2025-05-30 09:56:18 +02:00
parent ebf514bb78
commit 7c9c21118e
2 changed files with 14 additions and 2 deletions

View file

@ -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
}