mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-14 14:59:57 -04:00
logtail: remove MustParsePublicID (#6335)
This function is no longer necessary as you can trivially rewrite: logtail.MustParsePublicID(...) with: must.Get(logtail.ParsePublicID(...)) Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
1 parent
1de64e89cd
commit
eff62b7b1b
1 file changed
-10
@@ -109,16 +109,6 @@ func ParsePublicID(s string) (PublicID, error) {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// MustParsePublicID calls ParsePublicID and panics in case of an error.
|
||||
// It is intended for use with constant strings, typically in tests.
|
||||
func MustParsePublicID(s string) PublicID {
|
||||
id, err := ParsePublicID(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
func (id PublicID) MarshalText() ([]byte, error) {
|
||||
b := make([]byte, hex.EncodedLen(len(id)))
|
||||
if i := hex.Encode(b, id[:]); i != len(b) {
|
||||
|
||||
Reference in new issue
Block a user