Skip to content

Commit

Permalink
Remove the dependency on embryonic package gocheck in anticipation of…
Browse files Browse the repository at this point in the history
… the new API in golang/go#61342.
  • Loading branch information
bobg committed Dec 5, 2023
1 parent e6ea6d2 commit 381d213
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.21.0
require (
github.com/bobg/errors v0.10.0
github.com/bobg/go-generics/v3 v3.0.1
github.com/bobg/gocheck v0.0.0-20231205063213-8a1c02bc57e7
golang.org/x/mod v0.14.0
golang.org/x/tools v0.16.0
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ github.com/bobg/errors v0.10.0 h1:zlGq7hLqgaJILpwDmCDTnPvlvKI8M9Rh3uTRCuaMbiU=
github.com/bobg/errors v0.10.0/go.mod h1:lJenauJJF2tAdzEmND/wGVfA9kCChcj2p4KO/bNCz24=
github.com/bobg/go-generics/v3 v3.0.1 h1:0HwYkATwA5wiNZJGQvz+iy32XM7Jqpma+wQAKEdLyR0=
github.com/bobg/go-generics/v3 v3.0.1/go.mod h1:dIvFGgkJ/yLxLo1ocZKqYo9RrbfHfe+uIYnINMKblgo=
github.com/bobg/gocheck v0.0.0-20231205063213-8a1c02bc57e7 h1:0E/vrcas5lVzFqKgUQh9n6Yu0k53h7Mh+hZWZlkSLF4=
github.com/bobg/gocheck v0.0.0-20231205063213-8a1c02bc57e7/go.mod h1:hHMWUiJrLT3zKy4nmG04esa02C7zd9kgLy0CSxrulZ8=
github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0=
github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
Expand Down
31 changes: 2 additions & 29 deletions mingo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import (
"strconv"
"strings"
"testing"

"github.com/bobg/gocheck"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/packages"
)

func TestLangChecks(t *testing.T) {
Expand Down Expand Up @@ -99,31 +95,8 @@ func TestLangChecks(t *testing.T) {
}
})

t.Run("analyzer", func(t *testing.T) {
s := Scanner{Verbose: testing.Verbose()}
a, err := s.Analyzer()
if err != nil {
t.Fatal(err)
}
conf := &packages.Config{
Mode: Mode,
Dir: tmpdir,
Tests: s.Tests,
}
pkgs, err := packages.Load(conf, "./...")
if err != nil {
t.Fatal(err)
}

c := gocheck.Controller{Verbose: testing.Verbose()}
if _, err = c.Run(pkgs, []*analysis.Analyzer{a}); err != nil {
t.Fatal(err)
}

if s.Result.Version() != min {
t.Errorf("got %d, want %d", s.Result.Version(), min)
}
})
// TODO: check the same thing using Scanner.Analyzer
// (when the API in https://github.com/golang/go/issues/61324 lands)
})
}

Expand Down

0 comments on commit 381d213

Please sign in to comment.