I *do* use "go test", see https://github.com/tebeka/recheck/blob/master/regression_test.go
On Sunday, November 1, 2020 at 8:43:33 AM UTC+2 amits...@gmail.com wrote: > > > On Sun, 1 Nov 2020, 4:07 pm Miki Tebeka, <miki....@gmail.com> wrote: > >> Hi, >> >> I wrote a regexp linter (https://github.com/tebeka/recheck) that's using >> golang.org/x/tools/go/analysis. >> >> To test the tool, I run "go run ./cmd/recheck testdata/ok.go" (using >> os/exec). The problem is that after the test, go.mod & go.sum are modified >> since there are some external imports in the go files under testdata. >> >> I've tried using -mod=readonly, building & then running, moving the test >> file to /tmp - all of them didn't work, the mod files are still changed >> after the test. >> >> Any idea how can I prevent the test from modifing the mod files? >> > > Your example above suggests you are not using go test to execute your > tests? > > >> Thanks, >> Miki >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/701453b4-eaa7-4a92-a8a1-520ae6d66fcfn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/701453b4-eaa7-4a92-a8a1-520ae6d66fcfn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/bc16d6c7-131d-4666-9b01-2a41ba04c42bn%40googlegroups.com.