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 { ...@@ -23,7 +23,7 @@ type Fn struct {
// sub-API calls (e.g. track.getInfo for "now playing") may still fail with an // 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 // error, but just don't include the information they should've sent (or set it
// as unknown). // as unknown).
func (f *Fn) fmtError(err error) string { func fmtError(err error) string {
return fmt.Sprintf("Error: %s", err.Error()) return fmt.Sprintf("Error: %s", err.Error())
} }
......
...@@ -22,14 +22,14 @@ func (f *Fn) NowPlaying(message string, username string) string { ...@@ -22,14 +22,14 @@ func (f *Fn) NowPlaying(message string, username string) string {
return f.fmtNowPlaying(username, resp) return f.fmtNowPlaying(username, resp)
} }
return f.fmtError(err) return fmtError(err)
} }
func (f *Fn) UserArtistStats(message string, username string) string { func (f *Fn) UserArtistStats(message string, username string) string {
userArtistInfo, err := f.getUserArtistInfo(username, message) userArtistInfo, err := f.getUserArtistInfo(username, message)
if err != nil { if err != nil {
return f.fmtError(err) return fmtError(err)
} }
return f.fmtUserArtistStats(username, userArtistInfo) return f.fmtUserArtistStats(username, userArtistInfo)
...@@ -45,7 +45,7 @@ func (f *Fn) UserAlbumStats(message string, username string) string { ...@@ -45,7 +45,7 @@ func (f *Fn) UserAlbumStats(message string, username string) string {
userAlbumInfo, err := f.getUserAlbumInfo(username, artist, album) userAlbumInfo, err := f.getUserAlbumInfo(username, artist, album)
if err != nil { if err != nil {
return f.fmtError(err) return fmtError(err)
} }
return f.fmtUserAlbumStats(username, userAlbumInfo) 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