minor error formatting improvements

This commit is contained in:
sqshq 2019-05-20 00:14:13 -04:00
parent 911be1ba00
commit 1e1eeb34bd
4 changed files with 9 additions and 9 deletions

View File

@ -16,7 +16,7 @@ func NewAudioPlayer() *AudioPlayer {
bytes, err := Asset("quindar-tone.mp3") bytes, err := Asset("quindar-tone.mp3")
if err != nil { if err != nil {
log.Fatal("Can't find audio file") log.Fatal("Failed to find audio file")
} }
player, err := oto.NewPlayer(44100, 2, 2, 8192) player, err := oto.NewPlayer(44100, 2, 2, 8192)

View File

@ -33,7 +33,7 @@ func NewAsciiBox(c config.AsciiBoxConfig, palette console.Palette) *AsciiBox {
fontStr, err := asset.Asset(options.FontName + asciiFontExtension) fontStr, err := asset.Asset(options.FontName + asciiFontExtension)
if err != nil { if err != nil {
panic("Can't load the font: " + err.Error()) panic("Failed to load the font: " + err.Error())
} }
render := fl.NewAsciiRender() render := fl.NewAsciiRender()

View File

@ -88,21 +88,21 @@ func (c *Config) findComponent(componentType ComponentType, componentTitle strin
} }
panic(fmt.Sprintf( panic(fmt.Sprintf(
"Can't find component type %v with title %v", componentType, componentTitle)) "Failed to find component type %v with title %v", componentType, componentTitle))
} }
func readFile(location string) *Config { func readFile(location string) *Config {
yamlFile, err := ioutil.ReadFile(location) yamlFile, err := ioutil.ReadFile(location)
if err != nil { if err != nil {
log.Fatalf("Can't read config file: %s", location) log.Fatalf("Failed to read config file: %s", location)
} }
cfg := new(Config) cfg := new(Config)
err = yaml.Unmarshal(yamlFile, cfg) err = yaml.Unmarshal(yamlFile, cfg)
if err != nil { if err != nil {
log.Fatalf("Can't read config file: %v", err) log.Fatalf("Failed to read config file: %v", err)
} }
return cfg return cfg
@ -111,11 +111,11 @@ func readFile(location string) *Config {
func saveFile(config *Config, fileName string) { func saveFile(config *Config, fileName string) {
file, err := yaml.Marshal(config) file, err := yaml.Marshal(config)
if err != nil { if err != nil {
log.Fatalf("Can't marshal config file: %v", err) log.Fatalf("Failed to marshal config file: %v", err)
} }
err = ioutil.WriteFile(fileName, file, os.ModePerm) err = ioutil.WriteFile(fileName, file, os.ModePerm)
if err != nil { if err != nil {
log.Fatalf("Can't save config file: %v", err) log.Fatalf("Failed to save config file: %v", err)
} }
} }

View File

@ -25,7 +25,7 @@ func GetLicense() *License {
err := yaml.Unmarshal(file, license) err := yaml.Unmarshal(file, license)
if err != nil { if err != nil {
log.Fatalf("Can't read license file: %v", err) log.Fatalf("Failed to read license file: %v", err)
} }
return license return license
@ -41,7 +41,7 @@ func InitLicense() {
file, err := yaml.Marshal(license) file, err := yaml.Marshal(license)
if err != nil { if err != nil {
log.Fatalf("Can't marshal config file: %v", err) log.Fatalf("Failed to marshal config file: %v", err)
} }
initStorage() initStorage()