Skip to content

Commit

Permalink
Merge pull request #3 from tchajed/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
upamanyus authored Jul 14, 2024
2 parents 58bbe90 + a993132 commit 07be73b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions cmd/test_gen/main.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down
7 changes: 3 additions & 4 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path"
"regexp"
Expand Down Expand Up @@ -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 ""
}
Expand All @@ -94,15 +93,15 @@ 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)
}
}

// 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)
}
Expand Down
3 changes: 1 addition & 2 deletions machine/filesys/filesys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package filesys_test

import (
"fmt"
"io/ioutil"
"os"
"sort"
"testing"
Expand All @@ -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)
}
Expand Down

0 comments on commit 07be73b

Please sign in to comment.