mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-29 00:08:59 -07:00
fix: Replaced ioutil as it was deprecated in Golang.
This commit is contained in:
parent
82a964fc50
commit
97c8af8816
18 changed files with 105 additions and 114 deletions
|
@ -1,10 +1,10 @@
|
|||
package picol
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
errors "errors"
|
||||
fmt "fmt"
|
||||
strconv "strconv"
|
||||
strings "strings"
|
||||
)
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package picol_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
testing "testing"
|
||||
|
||||
"github.com/dragonheim/gagent/pkg/picol"
|
||||
picol "github.com/dragonheim/gagent/pkg/picol"
|
||||
)
|
||||
|
||||
func Test_NeedleInHaystack(t *testing.T) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
bufio "bufio"
|
||||
flag "flag"
|
||||
fmt "fmt"
|
||||
io "io"
|
||||
os "os"
|
||||
|
||||
picol "github.com/dragonheim/gagent/pkg/picol"
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ func RunPicol(fname string) error {
|
|||
interp := picol.NewInterpreter()
|
||||
interp.RegisterCoreCommands()
|
||||
|
||||
buf, err := ioutil.ReadFile(fname)
|
||||
buf, err := io.ReadFile(fname)
|
||||
if err == nil {
|
||||
result, err := interp.Eval(string(buf))
|
||||
if err != nil {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package main_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
io "io"
|
||||
os "os"
|
||||
testing "testing"
|
||||
|
||||
picol "github.com/dragonheim/gagent/pkg/picol/picol_unused"
|
||||
)
|
||||
|
@ -11,7 +11,7 @@ import (
|
|||
func Test_RunPicol(t *testing.T) {
|
||||
// Create a temporary test file
|
||||
content := []byte("set a 5\nset b 7\n+ $a $b\n")
|
||||
tmpfile, err := ioutil.TempFile("", "picol_test")
|
||||
tmpfile, err := io.TempFile("", "picol_test")
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating temporary test file: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue