message helper + io/ioutil deprecation

This commit is contained in:
ycc
2022-12-02 23:18:13 +01:00
parent 7ed8ff9982
commit a5cf1ec7ac
3 changed files with 48 additions and 10 deletions

View File

@ -2,7 +2,7 @@ package client
import (
"encoding/json"
"io/ioutil"
"os"
"sync"
)
@ -30,8 +30,8 @@ type Config struct {
GroupChatNotifiactions bool `json:"group_chat_notifiactions,omitempty"`
ChannelNotifications bool `json:"channel_notifications,omitempty"`
// Inner
memoryPassword string `json:"memory_password,omitempty"`
identityFile string `json:"config_file,omitempty"`
memoryPassword string
identityFile string
}
var instance *Config
@ -45,7 +45,7 @@ func GetConfig() *Config {
}
func (c *Config) Load(filename string) error {
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
return err
}
@ -61,7 +61,7 @@ func (c *Config) Save(filename string) error {
if err != nil {
return err
}
ioutil.WriteFile(filename, data, 0644)
os.WriteFile(filename, data, 0644)
if err != nil {
return err
}