Skip to content

Commit

Permalink
chore: update to go 1.21
Browse files Browse the repository at this point in the history
Prior to this change, we using go 1.20.

This change updates to go 1.21 and introduces the toolchain directive.
With this update the tools.go file is no longer required for the test
cases and it also highlighted some missing go mod tidy commands in the
test cases.
  • Loading branch information
au-phiware committed Mar 22, 2024
1 parent 2971f7b commit 81a63ae
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 92 deletions.
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- mock.go --
//go:build vermockstub

Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback_all_args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- HEADER --
// HEADER
-- mock.go --
Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback_flag_undefined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback_header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- HEADER --
// HEADER
-- mock.go --
Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback_packages_missing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/fallback_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- mock.go --
//go:build vermockstub

Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/flags_gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- mock.go --
//go:build vermockstub

Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen_all_args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- HEADER --
// HEADER
-- mock.go --
Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen_flag_undefined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,3 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen_header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- HEADER --
// HEADER
-- mock.go --
Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen_package.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- mock.go --
//go:build vermockstub

Expand Down
6 changes: 0 additions & 6 deletions cmd/vermockgen/testdata/gen_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module test
go 1.20

require github.com/Versent/go-vermock v0.0.0-00010101000000-000000000000
-- tools.go --
package main

import (
_ "github.com/Versent/go-vermock/cmd/vermockgen"
)
-- mock.go --
//go:build vermockstub

Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/Versent/go-vermock

go 1.20
go 1.21

toolchain go1.21.6

require (
github.com/google/subcommands v1.2.0
Expand Down
6 changes: 5 additions & 1 deletion internal/mock/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ func TestGenerate(t *testing.T) {
t,
context.Background(),
engine,
[]string{"MUT=" + mutdir},
[]string{
"PATH=" + os.Getenv("PATH"),
"HOME=" + os.Getenv("HOME"),
"MUT=" + mutdir,
},
"testdata/*.txt",
)
}
Expand Down
2 changes: 2 additions & 0 deletions internal/mock/testdata/custom_func.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

replace ../../../.. $MUT go.mod

exec go mod tidy

vermockgen

cmpenv stdout testdata/stdout
Expand Down
2 changes: 2 additions & 0 deletions internal/mock/testdata/custom_func_multi_expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

replace ../../../.. $MUT go.mod

exec go mod tidy

vermockgen

cmpenv stdout testdata/stdout
Expand Down
2 changes: 2 additions & 0 deletions internal/mock/testdata/custom_func_multi_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

replace ../../../.. $MUT go.mod

exec go mod tidy

vermockgen

cmpenv stdout testdata/stdout
Expand Down

0 comments on commit 81a63ae

Please sign in to comment.