summaryrefslogtreecommitdiff
path: root/core/core.go
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-03-18 16:10:37 -0600
committernytpu <alex@nytpu.com>2021-03-18 16:10:37 -0600
commitc3f5f7c68245f7f2d50a49be3e75c12af972ed8d (patch)
treeab8f5fb9e9a05abb486d959b7cb7390c92817c96 /core/core.go
parentf9f6a990944d29776c8304ccd1c977e2ffdb7879 (diff)
stop using ioutil
Diffstat (limited to 'core/core.go')
-rw-r--r--core/core.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/core.go b/core/core.go
index 6b68f3f..0500771 100644
--- a/core/core.go
+++ b/core/core.go
@@ -16,7 +16,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"sync"
@@ -38,7 +37,7 @@ func Init(dataPath string) error {
fi, err := f.Stat()
if err == nil && fi.Size() > 0 {
// File is not empty
- jsonBytes, err := ioutil.ReadAll(f)
+ jsonBytes, err := io.ReadAll(f)
f.Close()
if err != nil {
return fmt.Errorf("read comitium.json error: %w", err)
@@ -73,7 +72,7 @@ func (d *FullData) WriteJSON(dataPath string) error {
if err != nil {
return err
}
- err = ioutil.WriteFile(path, jsonBytes, 0666)
+ err = os.WriteFile(path, jsonBytes, 0666)
if err != nil {
return err
}