Change status package to deal with concrete types instead of interfaces (#1171)

This commit is contained in:
dfawley
2017-04-06 11:41:07 -07:00
committed by GitHub
parent b507112439
commit 1d27587e10
12 changed files with 82 additions and 102 deletions

View File

@ -156,7 +156,7 @@ func TestToRPCErr(t *testing.T) {
{transport.ErrConnClosing, status.Error(codes.Internal, transport.ErrConnClosing.Desc)},
} {
err := toRPCErr(test.errIn)
if _, ok := err.(status.Status); !ok {
if _, ok := status.FromError(err); !ok {
t.Fatalf("toRPCErr{%v} returned type %T, want %T", test.errIn, err, status.Error(codes.Unknown, ""))
}
if !reflect.DeepEqual(err, test.errOut) {