Adding a go version compatibility package.

Currently enables Errors.Is functionality as ErrorsIs.
Using this functionality in errors.go and unit tests.

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2020-02-25 18:05:07 -05:00
parent c18a5a2582
commit d8297ddf41
5 changed files with 84 additions and 5 deletions

View File

@@ -15,7 +15,6 @@ package server
import (
"bytes"
"errors"
"testing"
)
@@ -583,7 +582,7 @@ func TestMaxControlLine(t *testing.T) {
pub := []byte("PUB foo.bar 11\r")
err := c.parse(pub)
if !errors.Is(err, ErrMaxControlLine) {
if !IsErr(err, ErrMaxControlLine) {
t.Fatalf("Expected an error parsing longer than expected control line")
}
}