types/key: add missing ChallengePublic.UnmarshalText
Forgot it when adding the Challenge types earlier. Change-Id: Ie0872c4e6dc25e5d832aa58c7b3f66d450bf6b71 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
8c09ae9032
commit
4021ae6b9d
@@ -7,6 +7,7 @@ package key
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"go4.org/mem"
|
||||
"tailscale.com/types/structs"
|
||||
)
|
||||
|
||||
@@ -76,3 +77,8 @@ func (k ChallengePublic) String() string {
|
||||
func (k ChallengePublic) MarshalText() ([]byte, error) {
|
||||
return toHex(k.k[:], chalPublicHexPrefix), nil
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (k *ChallengePublic) UnmarshalText(b []byte) error {
|
||||
return parseHex(k.k[:], mem.B(b), mem.S(chalPublicHexPrefix))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user