Skip to content

Commit

Permalink
Rename Format method to Encode.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevina committed Aug 1, 2018
1 parent 8fd9ae9 commit f9a8f17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,9 @@ func (c *Cid) StringOfBase(base mbase.Encoding) (string, error) {
}
}

// Format return the string representation of a Cid
func (c *Cid) Format(base mbase.Encoder) string {
// Enccode return the string representation of a Cid in a given base
// when applicable
func (c *Cid) Encode(base mbase.Encoder) string {
switch c.version {
case 0:
return c.hash.B58String()
Expand Down
2 changes: 1 addition & 1 deletion cid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestBasesMarshaling(t *testing.T) {
if err != nil {
t.Fatal(err)
}
s2 := cid.Format(prefix)
s2 := cid.Encode(prefix)
if s != s2 {
t.Fatalf("'%s' != '%s'", s, s2)
}
Expand Down

0 comments on commit f9a8f17

Please sign in to comment.