types/model: remove MarshalText/UnmarshalText from Digest (#3586)
This commit is contained in:
parent
6a1de23175
commit
62f8cda3b3
1 changed files with 0 additions and 14 deletions
|
@ -38,20 +38,6 @@ func (d Digest) String() string { return d.s }
|
||||||
// ParseName(name).Digest().
|
// ParseName(name).Digest().
|
||||||
func (d Digest) IsValid() bool { return d.s != "" }
|
func (d Digest) IsValid() bool { return d.s != "" }
|
||||||
|
|
||||||
// MarshalText implements encoding.TextMarshaler.
|
|
||||||
func (d Digest) MarshalText() ([]byte, error) {
|
|
||||||
return []byte(d.String()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
||||||
func (d *Digest) UnmarshalText(text []byte) error {
|
|
||||||
if d.IsValid() {
|
|
||||||
return errors.New("model.Digest: illegal UnmarshalText on valid Digest")
|
|
||||||
}
|
|
||||||
*d = ParseDigest(string(text))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// LogValue implements slog.Value.
|
// LogValue implements slog.Value.
|
||||||
func (d Digest) LogValue() slog.Value {
|
func (d Digest) LogValue() slog.Value {
|
||||||
return slog.StringValue(d.String())
|
return slog.StringValue(d.String())
|
||||||
|
|
Loading…
Reference in a new issue