message helper + io/ioutil deprecation
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user