filecoin-project / filecoin-project/go-address
Implement TextMarshaler and TextUnmarshaler interfaces
- Dominant language
- Go
- Stars
- 16
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
This would broaden the range of use cases for address.Address, for example it is needed by the toml encoder.
```
// TextMarshaler is the interface implemented by an object that can
// marshal itself into a textual form.
//
// MarshalText encodes the receiver into UTF-8-encoded text and returns the result.
type TextMarshaler interface {
MarshalText() (text []byte, err error)
}
// TextUnmarshaler is the interface implemented by an object that can
// unmarshal a textual representation of itself.
//
// UnmarshalText must be able to decode the form generated by MarshalText.
// UnmarshalText must copy the text if it wishes to retain the text
// after returning.
type TextUnmarshaler interface {
UnmarshalText(text []byte) error
}
```
Contributor guide
Assessment
This issue has not been assessed yet.