Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
modlastfm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
stella-irc
modlastfm
Commits
c1cfbc44
Commit
c1cfbc44
authored
Oct 26, 2018
by
Mike Jones
🌶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmtError doesn't need access to Fn
parent
32154207
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
internal/app/modlastfm/command/init.go
internal/app/modlastfm/command/init.go
+1
-1
internal/app/modlastfm/command/user.go
internal/app/modlastfm/command/user.go
+3
-3
No files found.
internal/app/modlastfm/command/init.go
View file @
c1cfbc44
...
@@ -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
())
}
}
...
...
internal/app/modlastfm/command/user.go
View file @
c1cfbc44
...
@@ -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
.
f
mtError
(
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
.
f
mtError
(
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
.
f
mtError
(
err
)
return
fmtError
(
err
)
}
}
return
f
.
fmtUserAlbumStats
(
username
,
userAlbumInfo
)
return
f
.
fmtUserAlbumStats
(
username
,
userAlbumInfo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment