MCPcopy
hub / github.com/rs/xid / FromString

Function FromString

id.go:164–168  ·  view source on GitHub ↗

FromString reads an ID from its string representation

(id string)

Source from the content-addressed store, hash-verified

162
163// FromString reads an ID from its string representation
164func FromString(id string) (ID, error) {
165 i := &ID{}
166 err := i.UnmarshalText([]byte(id))
167 return *i, err
168}
169
170// String returns a base32 hex lowercased with no padding representation of the id (char set is 0-9, a-v).
171func (id ID) String() string {

Callers 8

TestIDValueFunction · 0.92
TestIDScanFunction · 0.92
TestPaddingFunction · 0.85
TestFromStringFunction · 0.85
TestFromStringInvalidFunction · 0.85
BenchmarkFromStringFunction · 0.85
TestFromStringQuickFunction · 0.85

Calls 1

UnmarshalTextMethod · 0.95

Tested by 8

TestIDValueFunction · 0.74
TestIDScanFunction · 0.74
TestPaddingFunction · 0.68
TestFromStringFunction · 0.68
TestFromStringInvalidFunction · 0.68
BenchmarkFromStringFunction · 0.68
TestFromStringQuickFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…