aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2022-06-12 22:40:40 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2022-06-12 22:40:40 +0100
commitd38a4ae585bb5061b264c667d65f2adf922934a7 (patch)
tree3c959b63346aad8e5d61ee1a566e1bdd93e953e2
parent17148b7d2981d98309f7346435f5d3e77c586ab4 (diff)
Add SPDX tags
-rw-r--r--net.go3
-rw-r--r--net_test.go3
-rw-r--r--testing.go9
-rw-r--r--util.go3
-rw-r--r--util_test.go3
5 files changed, 19 insertions, 2 deletions
diff --git a/net.go b/net.go
index bf2081b..040fe66 100644
--- a/net.go
+++ b/net.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: © 2022 Grégoire Duchêne <gduchene@awhk.org>
+// SPDX-License-Identifier: ISC
+
package core
import (
diff --git a/net_test.go b/net_test.go
index 3c01a15..487dd58 100644
--- a/net_test.go
+++ b/net_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: © 2022 Grégoire Duchêne <gduchene@awhk.org>
+// SPDX-License-Identifier: ISC
+
package core_test
import (
diff --git a/testing.go b/testing.go
index e18b4e9..ba22828 100644
--- a/testing.go
+++ b/testing.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: © 2022 Grégoire Duchêne <gduchene@awhk.org>
+// SPDX-License-Identifier: ISC
+
package core
import (
@@ -8,6 +11,8 @@ import (
"github.com/google/go-cmp/cmp"
)
+// T is a wrapper around the standard testing.T. It adds a few helper
+// functions, but behaves otherwise like testing.T.
type T struct {
*testing.T
Options []cmp.Option
@@ -26,13 +31,13 @@ func (t *T) AssertEqual(exp, actual any) bool {
return false
}
-func (t *T) AssertErrorIs(err, target error) bool {
+func (t *T) AssertErrorIs(target, err error) bool {
t.Helper()
if errors.Is(err, target) {
return true
}
- t.Errorf("\nexpected error to be %#v, got %#v", err, target)
+ t.Errorf("\nexpected error chain to contain %#v, got %#v", target, err)
return false
}
diff --git a/util.go b/util.go
index 34cf28b..d6f1985 100644
--- a/util.go
+++ b/util.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: © 2022 Grégoire Duchêne <gduchene@awhk.org>
+// SPDX-License-Identifier: ISC
+
package core
// Must panics if err is not nil. It returns val otherwise.
diff --git a/util_test.go b/util_test.go
index 65cc3bc..783c86b 100644
--- a/util_test.go
+++ b/util_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: © 2022 Grégoire Duchêne <gduchene@awhk.org>
+// SPDX-License-Identifier: ISC
+
package core_test
import (