Change 'IsNil' method to 'Defined'.

This commit is contained in:
Kevin Atkinson
2018-09-05 03:26:26 -04:00
parent 7b4617fa6e
commit 643f78a8f9

8
cid.go
View File

@@ -161,11 +161,11 @@ type Cid struct{ str string }
// also acceptable.
var Nil = Cid{}
// Nil returns true if a Cid is uninitialized or the Nil value.
// Calling any other methods on an uninitialized Cid will result in
// Defined returns true if a Cid is defined
// Calling any other methods on an undefined Cid will result in
// undefined behavior.
func (c Cid) IsNil() bool {
return c.str == ""
func (c Cid) Defined() bool {
return c.str != ""
}
// Parse is a short-hand function to perform Decode, Cast etc... on