mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Delete unused function
This commit is contained in:
parent
2fec736935
commit
1b32dd8277
@ -133,22 +133,6 @@ func LoadConfigFile(filePath string) *config.Config {
|
|||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReadConfigFile(fileName string) (string, error) {
|
|
||||||
configDir, err := ConfigDir()
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
filePath := fmt.Sprintf("%s/%s", configDir, fileName)
|
|
||||||
|
|
||||||
fileData, err := wtf.ReadFileBytes(filePath)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(fileData), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
const simpleConfig = `wtf:
|
const simpleConfig = `wtf:
|
||||||
colors:
|
colors:
|
||||||
border:
|
border:
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Colors = map[string]tcell.Color{
|
var colors = map[string]tcell.Color{
|
||||||
"aliceblue": tcell.ColorAliceBlue,
|
"aliceblue": tcell.ColorAliceBlue,
|
||||||
"antiquewhite": tcell.ColorAntiqueWhite,
|
"antiquewhite": tcell.ColorAntiqueWhite,
|
||||||
"aqua": tcell.ColorAqua,
|
"aqua": tcell.ColorAqua,
|
||||||
@ -148,8 +148,8 @@ var Colors = map[string]tcell.Color{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ColorFor(label string) tcell.Color {
|
func ColorFor(label string) tcell.Color {
|
||||||
if _, ok := Colors[label]; ok {
|
if _, ok := colors[label]; ok {
|
||||||
return Colors[label]
|
return colors[label]
|
||||||
} else {
|
} else {
|
||||||
return tcell.ColorGreen
|
return tcell.ColorGreen
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user