github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/cmd/ipfs/main_test.go (about) 1 package main 2 3 import ( 4 "testing" 5 6 "github.com/ipfs/go-ipfs/commands" 7 ) 8 9 func TestIsCientErr(t *testing.T) { 10 t.Log("Catch both pointers and values") 11 if !isClientError(commands.Error{Code: commands.ErrClient}) { 12 t.Errorf("misidentified value") 13 } 14 if !isClientError(&commands.Error{Code: commands.ErrClient}) { 15 t.Errorf("misidentified pointer") 16 } 17 }