Commit c1cfbc44 authored by Mike Jones's avatar Mike Jones 🌶

fmtError doesn't need access to Fn

parent 32154207
......@@ -23,7 +23,7 @@ type Fn struct {
// sub-API calls (e.g. track.getInfo for "now playing") may still fail with an
// error, but just don't include the information they should've sent (or set it
// as unknown).
func (f *Fn) fmtError(err error) string {
func fmtError(err error) string {
return fmt.Sprintf("Error: %s", err.Error())
}
......
......@@ -22,14 +22,14 @@ func (f *Fn) NowPlaying(message string, username string) string {
return f.fmtNowPlaying(username, resp)
}
return f.fmtError(err)
return fmtError(err)
}
func (f *Fn) UserArtistStats(message string, username string) string {
userArtistInfo, err := f.getUserArtistInfo(username, message)
if err != nil {
return f.fmtError(err)
return fmtError(err)
}
return f.fmtUserArtistStats(username, userArtistInfo)
......@@ -45,7 +45,7 @@ func (f *Fn) UserAlbumStats(message string, username string) string {
userAlbumInfo, err := f.getUserAlbumInfo(username, artist, album)
if err != nil {
return f.fmtError(err)
return fmtError(err)
}
return f.fmtUserAlbumStats(username, userAlbumInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment