Преглед изворни кода

refactor: move config/* to util package

ayntgl пре 4 година
родитељ
комит
3f1725c0a7
2 измењених фајлова са 5 додато и 5 уклоњено
  1. 3 3
      ui/app.go
  2. 2 2
      util/config.go

+ 3 - 3
ui/app.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 
 	"github.com/ayntgl/discordgo"
-	"github.com/ayntgl/discordo/config"
+	"github.com/ayntgl/discordo/util"
 	"github.com/gen2brain/beeep"
 	"github.com/rivo/tview"
 )
@@ -20,7 +20,7 @@ type App struct {
 	MessageInputField *tview.InputField
 	Session           *discordgo.Session
 	SelectedChannel   *discordgo.Channel
-	Config            config.Config
+	Config            util.Config
 	SelectedMessage   int
 }
 
@@ -35,7 +35,7 @@ func NewApp() *App {
 		MessageInputField: tview.NewInputField(),
 
 		Session:         s,
-		Config:          config.Load(),
+		Config:          util.LoadConfig(),
 		SelectedMessage: -1,
 	}
 }

+ 2 - 2
config/mod.go → util/config.go

@@ -1,4 +1,4 @@
-package config
+package util
 
 import (
 	"os"
@@ -33,7 +33,7 @@ type Config struct {
 	Keybindings KeybindingsConfig `toml:"keybindings"`
 }
 
-func Load() Config {
+func LoadConfig() Config {
 	configPath, err := os.UserConfigDir()
 	if err != nil {
 		panic(err)