summaryrefslogtreecommitdiff
path: root/core/core.go
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-03-21 07:36:04 -0600
committernytpu <alex@nytpu.com>2021-03-21 07:36:04 -0600
commit69a7ab13ffb4a3d851e21727683dbed1ccc0e469 (patch)
treee3f91fafe9075be725c223ac2a192182f2632482 /core/core.go
parenta6914cb4102b321130e321091ef0413ba2a15dc9 (diff)
Remove usages of io.ReadFile and os.WriteFile to be compatible with 1.15
Diffstat (limited to 'core/core.go')
-rw-r--r--core/core.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/core.go b/core/core.go
index afa20d0..513c84c 100644
--- a/core/core.go
+++ b/core/core.go
@@ -15,7 +15,7 @@ package core
import (
"encoding/json"
"fmt"
- "io"
+ "io/ioutil"
"os"
"path/filepath"
"sync"
@@ -37,7 +37,7 @@ func Init(dataPath string) error {
fi, err := f.Stat()
if err == nil && fi.Size() > 0 {
// File is not empty
- jsonBytes, err := io.ReadAll(f)
+ jsonBytes, err := ioutil.ReadAll(f)
f.Close()
if err != nil {
return fmt.Errorf("read comitium.json error: %w", err)
@@ -72,7 +72,7 @@ func (d *FullData) WriteJSON(dataPath string) error {
if err != nil {
return err
}
- err = os.WriteFile(path, jsonBytes, 0666)
+ err = ioutil.WriteFile(path, jsonBytes, 0666)
if err != nil {
return err
}