Open KendallWeihe opened 7 months ago
I'm just going to stub this in for now because as I think this through it may be a bit more of a can of worms than just adding two new functions. Here is where I land right now
func (d PortableDID) ToString() (string, error) {
}
func ParsePortableDID(portableDID string) (PortableDID, error) {
}
And then ToString()
would have an options parameter to offer indentation (and whitespace?) features... anything else...?
More thoughtful exploration...
Scan()
and Value()
are useful too for DB serialization. I like String()
and Parse()
for general purpose
Originally spurred from discourse here https://github.com/TBD54566975/web5-go/pull/77#discussion_r1503311299
PortableDID's being serializable, and you know, intending to be portable, it may be good practice to offer dedicated functions for serializing/deserializing
This would immediately be applicable to the "indentation" component of this feature https://github.com/TBD54566975/web5-go/issues/64
Now we are faced with the decision's...
I think it's safe to assume we would want to/from strings, but what about byte arrays?