refactor: clean up unused const
All checks were successful
REUSE Compliance Check / check (push) Successful in 5s

This commit is contained in:
Dan Anglin 2024-08-18 09:57:48 +01:00
parent 277bec49ef
commit 15b9761497
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
6 changed files with 33 additions and 45 deletions

View file

@ -0,0 +1,29 @@
package executor
const (
flagFrom string = "from"
flagTo string = "to"
flagType string = "type"
resourceAccount string = "account"
resourceBlocked string = "blocked"
resourceBookmarks string = "bookmarks"
resourceBoost string = "boost"
resourceFollowers string = "followers"
resourceFollowing string = "following"
resourceFollowRequest string = "follow-request"
resourceInstance string = "instance"
resourceLike string = "like"
resourceLiked string = "liked"
resourceList string = "list"
resourceMedia string = "media"
resourceMediaAttachment string = "media-attachment"
resourceMutedAccounts string = "muted-accounts"
resourceNote string = "note"
resourcePoll string = "poll"
resourceStatus string = "status"
resourceStar string = "star"
resourceStarred string = "starred"
resourceTimeline string = "timeline"
resourceVote string = "vote"
)

View file

@ -34,12 +34,12 @@ func (c *CreateExecutor) Execute() error {
func (c *CreateExecutor) createList(gtsClient *client.Client) error {
if c.listTitle == "" {
return FlagNotSetError{flagText: flagListTitle}
return Error{"please provide the title of the list that you want to create"}
}
parsedListRepliesPolicy, err := model.ParseListRepliesPolicy(c.listRepliesPolicy)
if err != nil {
return err
return err //nolint:wrapcheck
}
form := client.CreateListForm{

View file

@ -1,12 +0,0 @@
package executor
const (
flagAttachmentID = "attachment-id"
flagContent = "content"
flagFrom = "from"
flagInstance = "instance"
flagListTitle = "list-title"
flagTag = "tag"
flagTo = "to"
flagType = "type"
)

View file

@ -13,7 +13,7 @@ func (l *LoginExecutor) Execute() error {
var err error
if l.instance == "" {
return FlagNotSetError{flagText: flagInstance}
return Error{"please specify the instance that you want to log into"}
}
instance := l.instance

View file

@ -1,25 +0,0 @@
package executor
const (
resourceAccount = "account"
resourceBlocked = "blocked"
resourceBookmarks = "bookmarks"
resourceBoost = "boost"
resourceFollowers = "followers"
resourceFollowing = "following"
resourceFollowRequest = "follow-request"
resourceInstance = "instance"
resourceLike = "like"
resourceLiked = "liked"
resourceList = "list"
resourceMedia = "media"
resourceMediaAttachment = "media-attachment"
resourceMutedAccounts = "muted-accounts"
resourceNote = "note"
resourcePoll = "poll"
resourceStatus = "status"
resourceStar = "star"
resourceStarred = "starred"
resourceTimeline = "timeline"
resourceVote = "vote"
)

View file

@ -176,7 +176,7 @@ func (s *ShowExecutor) showTimeline(gtsClient *client.Client) error {
timeline, err = gtsClient.GetListTimeline(list.ID, list.Title, s.limit)
case model.TimelineCategoryTag:
if s.tag == "" {
return FlagNotSetError{flagText: flagTag}
return Error{"please provide the name of the tag"}
}
timeline, err = gtsClient.GetTagTimeline(s.tag, s.limit)
@ -416,10 +416,6 @@ func (s *ShowExecutor) showMutedAccounts(gtsClient *client.Client) error {
}
func (s *ShowExecutor) showMediaAttachment(gtsClient *client.Client) error {
if len(s.attachmentIDs) == 0 {
return FlagNotSetError{flagText: flagAttachmentID}
}
if len(s.attachmentIDs) != 1 {
return fmt.Errorf(
"unexpected number of attachment IDs received: want 1, got %d",