refactor: move config/* to util package
This commit is contained in:
parent
288fcff0f0
commit
3f1725c0a7
2 changed files with 5 additions and 5 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
Loading…
Add table
Reference in a new issue