diff --git a/multihash/multihash.go b/multihash/multihash.go index 4624b2c..7648877 100644 --- a/multihash/multihash.go +++ b/multihash/multihash.go @@ -18,7 +18,7 @@ type Multihash struct { FullBytes []byte } -func NewMultihash(fullBytes []byte) *Multihash { +func New(fullBytes []byte) *Multihash { return &Multihash{FullBytes: fullBytes} } @@ -42,7 +42,7 @@ func FromBase64Url(hash string) (*Multihash, error) { if err != nil { return nil, err } - return NewMultihash(ret), nil + return New(ret), nil } func (m *Multihash) ToBase64Url() (string, error) { diff --git a/multihash/multihash_test.go b/multihash/multihash_test.go index 05b9d43..400cc7f 100644 --- a/multihash/multihash_test.go +++ b/multihash/multihash_test.go @@ -203,8 +203,8 @@ func TestNewMultihash(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := NewMultihash(tt.args.fullBytes); !reflect.DeepEqual(got, tt.want) { - t.Errorf("NewMultihash() = %v, want %v", got, tt.want) + if got := New(tt.args.fullBytes); !reflect.DeepEqual(got, tt.want) { + t.Errorf("New() = %v, want %v", got, tt.want) } }) }