Parcourir la source

refactor: rename LoadConfig to NewConfig

ayntgl il y a 4 ans
Parent
commit
be46288500
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 1 1
      main.go
  2. 2 1
      util/config.go

+ 1 - 1
main.go

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

+ 2 - 1
util/config.go

@@ -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)