refactor: rename LoadConfig to NewConfig

This commit is contained in:
ayntgl 2021-11-13 21:16:29 +04:00
parent 5361e412ae
commit be46288500
2 changed files with 3 additions and 2 deletions

View file

@ -24,7 +24,7 @@ var (
)
func main() {
conf = util.LoadConfig()
conf = util.NewConfig()
tview.Borders = conf.Borders

View file

@ -70,7 +70,8 @@ type Config struct {
Borders borders `toml:"borders"`
}
func LoadConfig() *Config {
// NewConfig loads the configuration file, if the configuration file exists or creates a new one if not, and returns it.
func NewConfig() *Config {
configPath, err := os.UserConfigDir()
if err != nil {
panic(err)