Skip to content

Commit af3ea2b

Browse files
authored
Fix issues and typos reported by Go Report Card (#12)
1 parent e855b62 commit af3ea2b

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

pkg/internal/builder/builder_api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (b *Builder) IsError(expected error) *predicate.Predicate {
142142
// ---------------------------------------------------------------------------
143143
// From pkg/internal/predicate/impl/ext.go
144144

145-
// Is is an extention point allowing for the definition of a custom
145+
// Is is an extension point allowing for the definition of a custom
146146
// predicate function to evaluate a predicate chain
147147
func (b *Builder) Is(desc string, f predicate.PredicateFunc) *predicate.Predicate {
148148
b.p.RegisterPredicate(impl.Is(desc, f))
@@ -153,7 +153,7 @@ func (b *Builder) Is(desc string, f predicate.PredicateFunc) *predicate.Predicat
153153
return &b.p
154154
}
155155

156-
// Eval is an extention point allowing for the definition of custom
156+
// Eval is an extension point allowing for the definition of custom
157157
// transformation functions in a predicate chain
158158
func (b *Builder) Eval(desc string, f predicate.TransformFunc) *Builder {
159159
b.p.RegisterTransformation(impl.Eval(desc, f))

pkg/internal/predicate/impl/ext.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"github.com/maargenton/go-testpredicate/pkg/internal/predicate"
55
)
66

7-
// Is is an extention point allowing for the definition of a custom
7+
// Is is an extension point allowing for the definition of a custom
88
// predicate function to evaluate a predicate chain
99
func Is(desc string, f predicate.PredicateFunc) (string, predicate.PredicateFunc) {
1010
return desc, f
1111
}
1212

13-
// Eval is an extention point allowing for the definition of custom
13+
// Eval is an extension point allowing for the definition of custom
1414
// transformation functions in a predicate chain
1515
func Eval(desc string, f predicate.TransformFunc) (string, predicate.TransformFunc) {
1616
return desc, f

pkg/prettyprint/token.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ func nextToken(is string) (t token, os string) {
128128
if empty {
129129
t = next
130130
return
131-
} else {
132-
ts += "...} " + next.str
133131
}
132+
ts += "...} " + next.str
134133
}
135134
t = makeToken(ts)
136135
return

pkg/require/require.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/maargenton/go-testpredicate/pkg/internal/predicate"
88
)
99

10+
// Context captures an additional context value to be displayed upon failure.
1011
type Context = predicate.ContextValue
1112

1213
// That captrues the test context and a value for the purpose of building and

pkg/value/field.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
// Field takes a root value or an array of root values, navigates through the
9-
// data tree according to a keypath, and returns the targetted values. `keypath`
9+
// data tree according to a keypath, and returns the targeted values. `keypath`
1010
// is a dot-separated list of keys, each used as either field name in a struct,
1111
// a key in a map, or a niladic method name. Any error during key evalation
1212
// results in a nil value. If a method invocation yields multiple return values,
@@ -21,7 +21,7 @@ import (
2121
//
2222
// Because the implementation is using the reflect package and is mostly type
2323
// agnostic, the resulting arrays are always of type []interface{}, even if the
24-
// field types are consistent accross values.
24+
// field types are consistent across values.
2525
func Field(value interface{}, keypath string) interface{} {
2626
var keys = strings.Split(keypath, ".")
2727
return field(value, keys)

pkg/verify/verify.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/maargenton/go-testpredicate/pkg/internal/predicate"
88
)
99

10+
// Context captures an additional context value to be displayed upon failure.
1011
type Context = predicate.ContextValue
1112

1213
// That captrues the test context and a value for the purpose of building and

0 commit comments

Comments
 (0)