File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package simple_json_db
33import (
44 "encoding/json"
55 "fmt"
6- "io/ioutil"
76 "os"
87 "path/filepath"
98 "strings"
@@ -48,8 +47,10 @@ func (db *SimpleDB) init() {
4847 }
4948 if db .debugEnabled {
5049 fmt .Println ("[SimpleDB] File path set" )
50+ fmt .Printf ("[SimpleDB] File path is: %s\n " , db .filePath )
5151 }
52- fileContent , err := ioutil .ReadFile (db .filePath )
52+
53+ fileContent , err := os .ReadFile (db .filePath )
5354 if err == nil {
5455 json .Unmarshal (fileContent , & db .data )
5556 }
@@ -63,7 +64,7 @@ func (db *SimpleDB) writeDb() {
6364 fmt .Println ("[SimpleDB] Writing database to file" )
6465 }
6566 fileContent , _ := json .Marshal (db .data )
66- ioutil .WriteFile (db .filePath , fileContent , 0644 )
67+ os .WriteFile (db .filePath , fileContent , 0644 )
6768 db .timeoutRemove ()
6869}
6970
You can’t perform that action at this time.
0 commit comments