diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9887576d..5f7f438f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,15 +11,15 @@ jobs: test: strategy: matrix: - go-version: ["1.18.x"] + go-version: ["1.22.x"] os: ["ubuntu-latest"] runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - name: Check style diff --git a/cmd/test_gen/main.go b/cmd/test_gen/main.go index 49399927..87867137 100644 --- a/cmd/test_gen/main.go +++ b/cmd/test_gen/main.go @@ -1,11 +1,10 @@ -//go:generate go run main.go -go -out ../../internal/examples/semantics/generated_test.go ../../internal/examples/semantics +//go:generate go run main.go -go -out ../../testdata/examples/semantics/generated_test.go ../../testdata/examples/semantics package main import ( "bufio" "flag" "fmt" - "io/ioutil" "os" "path" "regexp" @@ -96,7 +95,7 @@ func main() { os.Exit(1) } srcDir := flag.Arg(0) - files, err := ioutil.ReadDir(srcDir) + files, err := os.ReadDir(srcDir) if err != nil { panic(err) } diff --git a/examples_test.go b/examples_test.go index 6408eef2..3d5bdc47 100644 --- a/examples_test.go +++ b/examples_test.go @@ -19,7 +19,6 @@ import ( "go/ast" "go/parser" "go/token" - "io/ioutil" "os" "path" "regexp" @@ -85,7 +84,7 @@ func (t positiveTest) ActualFile() string { // Gold returns the contents of the gold Ast as a string func (t positiveTest) Gold() string { - expected, err := ioutil.ReadFile(t.GoldFile()) + expected, err := os.ReadFile(t.GoldFile()) if err != nil { return "" } @@ -94,7 +93,7 @@ func (t positiveTest) Gold() string { // UpdateGold updates the gold output with real results func (t positiveTest) UpdateGold(actual string) { - err := ioutil.WriteFile(t.GoldFile(), []byte(actual), 0644) + err := os.WriteFile(t.GoldFile(), []byte(actual), 0644) if err != nil { panic(err) } @@ -102,7 +101,7 @@ func (t positiveTest) UpdateGold(actual string) { // PutActual updates the actual test output with the real results func (t positiveTest) PutActual(actual string) { - err := ioutil.WriteFile(t.ActualFile(), []byte(actual), 0644) + err := os.WriteFile(t.ActualFile(), []byte(actual), 0644) if err != nil { panic(err) } diff --git a/machine/filesys/filesys_test.go b/machine/filesys/filesys_test.go index 01fba654..e8ebbe5e 100644 --- a/machine/filesys/filesys_test.go +++ b/machine/filesys/filesys_test.go @@ -2,7 +2,6 @@ package filesys_test import ( "fmt" - "io/ioutil" "os" "sort" "testing" @@ -23,7 +22,7 @@ func (s *FilesysSuite) SetupTest() { s.fs = filesys.NewMemFs() } else { var err error - s.dir, err = ioutil.TempDir("", "test.dir") + s.dir, err = os.MkdirTemp("", "test.dir") if err != nil { panic(err) }