mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-15 14:16:17 -06:00
id: removal of unused constructors
This commit is contained in:
parent
92425f434d
commit
fc43db429f
1 changed files with 0 additions and 19 deletions
19
id/id.go
19
id/id.go
|
|
@ -31,25 +31,6 @@ func New(data []byte) ID {
|
|||
return id
|
||||
}
|
||||
|
||||
// NewFromString creates a new ID from the given string.
|
||||
func NewFromString(s string) ID {
|
||||
return New([]byte(s))
|
||||
}
|
||||
|
||||
// NewFromBytes creates a new ID with the value of the given byte slice. The
|
||||
// given byte slice must be 32 bytes long (the same length as ID), or this
|
||||
// function will panic.
|
||||
func NewFromBytes(b []byte) ID {
|
||||
var id ID
|
||||
|
||||
if len(b) != len(id) {
|
||||
panic("invalid slice length for id")
|
||||
}
|
||||
|
||||
copy(id[0:], b)
|
||||
return id
|
||||
}
|
||||
|
||||
// String returns the canonical representation of the ID.
|
||||
func (i ID) String() string {
|
||||
ss := base32.StdEncoding.EncodeToString(i[:])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue