fix deprecation
Some checks failed
Build / build (push) Failing after 6m14s
Publish Image / publish (push) Failing after 36s
Test / build (push) Failing after 6m15s

This commit is contained in:
Chuck Smith
2024-03-29 11:04:21 -04:00
parent 12d43c9835
commit 7435a993d9
3 changed files with 12 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
package builtins
import (
"io/ioutil"
"monkey/internal/object"
"monkey/internal/typing"
"os"
)
// WriteFile ...
@@ -19,7 +19,7 @@ func WriteFile(args ...object.Object) object.Object {
filename := args[0].(*object.String).Value
data := []byte(args[1].(*object.String).Value)
err := ioutil.WriteFile(filename, data, 0755)
err := os.WriteFile(filename, data, 0755)
if err != nil {
return newError("IOError: error writing file %s: %s", filename, err)
}