Using utils.Print instead of fmt.Println

This commit is contained in:
aditya-K2 2022-10-04 01:51:16 +05:30
parent 06da246c3a
commit 387f01f531
1 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
package config package config
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"strings" "strings"
@ -39,7 +38,7 @@ func ReadConfig() {
err := viper.ReadInConfig() err := viper.ReadInConfig()
if err != nil { if err != nil {
fmt.Println("Could Not Read Config file.") utils.Print("RED", "Could Not Read Config file.\n")
} }
// Expanding ~ to the User's Home Directory // Expanding ~ to the User's Home Directory
@ -66,7 +65,7 @@ func GenerateKeyMap(funcMap map[string]func()) {
func getMusicDirectory() string { func getMusicDirectory() string {
content, err := ioutil.ReadFile(HOME_DIR + "/.config/mpd/mpd.conf") content, err := ioutil.ReadFile(HOME_DIR + "/.config/mpd/mpd.conf")
if err != nil { if err != nil {
fmt.Println("No Config File for mpd Found") utils.Print("RED", "No Config File for mpd Found.\n")
panic(err) panic(err)
} }
ab := string(content) ab := string(content)