Commit c5b9e98
committed
remove uses of errors.Is, which requires go1.13
Commit 1bf832c introduced the use of
`errors.Is`, which was added in [go1.13], but the `go.mod` was not
updated to reflect this, causing compile failures on go1.12:
docker run -it --rm -v ./:/pflag -w /pflag golang:1.12 sh -c 'go test -v ./...'
# github.com/spf13/pflag [github.com/spf13/pflag.test]
./flag.go:1190:7: undefined: errors.Is
./flag.go:1219:7: undefined: errors.Is
./bool_func_test.go:86:28: cannot use stdFSet (type *flag.FlagSet) as type BoolFuncFlagSet in argument to runCase:
*flag.FlagSet does not implement BoolFuncFlagSet (missing BoolFunc method)
...
As the error that is tested will not be wrapped, we can omit the `errors.Is`,
and instead continue doing a straight comparison.
[go1.13]: https://pkg.go.dev/errors@go1.13#Is
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>1 parent 1043857 commit c5b9e98
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
| 1188 | + | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
| |||
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
1217 | | - | |
| 1217 | + | |
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| |||
0 commit comments