Skip to content

Commit

Permalink
Merge pull request #128 from gliderlabs/update-go-version
Browse files Browse the repository at this point in the history
chore: update go version to 1.22
  • Loading branch information
josegonzalez authored Jun 29, 2024
2 parents d54b939 + 0428ab5 commit 4b58e8f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: crazy-max/ghaction-xgo@v3
with:
xgo_version: latest
go_version: 1.21
go_version: 1.22
dest: dist
prefix: ${{ steps.repo-name.outputs.REPOSITORY_NAME }}
targets: darwin/amd64,darwin/arm64,linux/arm64,linux/amd64
Expand Down
14 changes: 7 additions & 7 deletions builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"os/exec"
Expand Down Expand Up @@ -251,7 +251,7 @@ func Trim(in interface{}) (interface{}, error) {
func read(file interface{}) ([]byte, error) {
reader, ok := file.(sigil.NamedReader)
if ok {
return ioutil.ReadAll(reader)
return io.ReadAll(reader)
}
path, _, ok := sigil.String(file)
if !ok {
Expand All @@ -261,7 +261,7 @@ func read(file interface{}) ([]byte, error) {
if err != nil {
return []byte{}, err
}
data, err := ioutil.ReadFile(filepath)
data, err := os.ReadFile(filepath)
if err != nil {
return []byte{}, err
}
Expand Down Expand Up @@ -437,7 +437,7 @@ func Include(filename string, args ...interface{}) (interface{}, error) {
if err != nil {
return "", err
}
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -497,7 +497,7 @@ func Dir(in interface{}) ([]interface{}, error) {
return nil, fmt.Errorf("dir must be given a string")
}
var files []interface{}
dir, err := ioutil.ReadDir(path)
dir, err := os.ReadDir(path)
if err != nil {
return nil, err
}
Expand All @@ -513,7 +513,7 @@ func Dirs(in interface{}) ([]interface{}, error) {
return nil, fmt.Errorf("dirs must be given a string")
}
var dirs []interface{}
dir, err := ioutil.ReadDir(path)
dir, err := os.ReadDir(path)
if err != nil {
return nil, err
}
Expand All @@ -531,7 +531,7 @@ func Files(in interface{}) ([]interface{}, error) {
return nil, fmt.Errorf("files must be given a string")
}
var files []interface{}
dir, err := ioutil.ReadDir(path)
dir, err := os.ReadDir(path)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/sigil.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"flag"
"fmt"
"io/ioutil"
"io"
"os"
"path/filepath"
"strings"
Expand All @@ -23,7 +23,7 @@ var (

func template() ([]byte, string, error) {
if *filename != "" {
data, err := ioutil.ReadFile(*filename)
data, err := os.ReadFile(*filename)
if err != nil {
return []byte{}, "", err
}
Expand All @@ -33,7 +33,7 @@ func template() ([]byte, string, error) {
if *inline != "" {
return []byte(*inline), "<inline>", nil
}
data, err := ioutil.ReadAll(os.Stdin)
data, err := io.ReadAll(os.Stdin)
if err != nil {
return []byte{}, "", err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gliderlabs/sigil

go 1.18
go 1.22

require (
github.com/dustin/go-jsonpointer v0.0.0-20160814072949-ba0abeacc3dc
Expand Down
3 changes: 1 addition & 2 deletions sigil.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -41,7 +40,7 @@ func String(in interface{}) (string, string, bool) {
case string:
return obj, "", true
case NamedReader:
data, err := ioutil.ReadAll(obj)
data, err := io.ReadAll(obj)
if err != nil {
// TODO: better overall error/panic handling
panic(err)
Expand Down
3 changes: 1 addition & 2 deletions sigil_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sigil

import (
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand All @@ -12,7 +11,7 @@ func TestLookPath(t *testing.T) {
for _, relative := range []bool{true, false} {
for _, exists := range []bool{true, false} {
// setup
f, err := ioutil.TempFile(tmpDir, "sigiltest")
f, err := os.CreateTemp(tmpDir, "sigiltest")
if err != nil {
t.Error("failed to crate temporary file")
continue
Expand Down

0 comments on commit 4b58e8f

Please sign in to comment.