mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 19:07:48 +08:00
Discovered this quirk about interfaces. @whyrusleeping @mappum @jbenet License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
18 lines
358 B
Go
18 lines
358 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/jbenet/go-ipfs/commands"
|
|
)
|
|
|
|
func TestIsCientErr(t *testing.T) {
|
|
t.Log("Catch both pointers and values")
|
|
if !isClientError(commands.Error{Code: commands.ErrClient}) {
|
|
t.Errorf("misidentified value")
|
|
}
|
|
if !isClientError(&commands.Error{Code: commands.ErrClient}) {
|
|
t.Errorf("misidentified pointer")
|
|
}
|
|
}
|