ksuid icon indicating copy to clipboard operation
ksuid copied to clipboard

How do I convert from `string` to `ksuid.KSUID` format?

Open myrtleTree33 opened this issue 4 years ago • 1 comments

Hi,

I would like to check if this approach is correct:

id := &ksuid.KSUID{}
id.UnmarshalText([]byte(IdStr))

myrtleTree33 avatar Oct 18 '21 10:10 myrtleTree33

@myrtleTree33, I would recommend to use ksuid.Parse(YourIdStr) method: https://github.com/segmentio/ksuid/blob/master/ksuid.go#L177-L191 It's used in ksuid inspect command as well.

pavel-github avatar Dec 01 '21 14:12 pavel-github