From 85995d4754352f755c1c7bf2a71b207ef515df05 Mon Sep 17 00:00:00 2001 From: chaoqun <27287694+OpenWaygate@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:26:43 +0800 Subject: [PATCH] :recycle: Flag variable name to lowercase --- cmd/comment/comment.go | 26 ++++++++++++++------------ cmd/comment/delete.go | 6 +++--- cmd/comment/markAsSpam.go | 6 +++--- cmd/comment/setModerationStatus.go | 14 +++++++------- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/cmd/comment/comment.go b/cmd/comment/comment.go index ffe5d8e..8b04304 100644 --- a/cmd/comment/comment.go +++ b/cmd/comment/comment.go @@ -6,18 +6,20 @@ import ( ) var ( - IDs []string - AuthorChannelId string - CanRate bool - ChannelId string - MaxResults int64 - ParentId string - TextFormat string - TextOriginal string - ModerationStatus string - BanAuthor bool - VideoId string - ViewerRating string + ids []string + authorChannelId string + canRate bool + channelId string + maxResults int64 + parentId string + textFormat string + textOriginal string + moderationStatus string + banAuthor bool + videoId string + viewerRating string + parts []string + output string ) var commentCmd = &cobra.Command{ diff --git a/cmd/comment/delete.go b/cmd/comment/delete.go index a4285b0..83f96c1 100644 --- a/cmd/comment/delete.go +++ b/cmd/comment/delete.go @@ -8,10 +8,10 @@ import ( var deleteCmd = &cobra.Command{ Use: "delete", Short: "Delete YouTube comments", - Long: "Delete YouTube comments by IDs", + Long: "Delete YouTube comments by ids", Run: func(cmd *cobra.Command, args []string) { c := comment.NewComment( - comment.WithIDs(IDs), + comment.WithIDs(ids), comment.WithService(nil), ) c.Delete() @@ -21,5 +21,5 @@ var deleteCmd = &cobra.Command{ func init() { commentCmd.AddCommand(deleteCmd) - deleteCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments") + deleteCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments") } diff --git a/cmd/comment/markAsSpam.go b/cmd/comment/markAsSpam.go index 4c249fe..69337fb 100644 --- a/cmd/comment/markAsSpam.go +++ b/cmd/comment/markAsSpam.go @@ -8,10 +8,10 @@ import ( var markAsSpamCmd = &cobra.Command{ Use: "markAsSpam", Short: "Mark YouTube comments as spam", - Long: "Mark YouTube comments as spam by IDs", + Long: "Mark YouTube comments as spam by ids", Run: func(cmd *cobra.Command, args []string) { c := comment.NewComment( - comment.WithIDs(IDs), + comment.WithIDs(ids), comment.WithService(nil), ) c.MarkAsSpam(false) @@ -21,5 +21,5 @@ var markAsSpamCmd = &cobra.Command{ func init() { commentCmd.AddCommand(markAsSpamCmd) - markAsSpamCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments") + markAsSpamCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments") } diff --git a/cmd/comment/setModerationStatus.go b/cmd/comment/setModerationStatus.go index d35be01..72d054d 100644 --- a/cmd/comment/setModerationStatus.go +++ b/cmd/comment/setModerationStatus.go @@ -8,12 +8,12 @@ import ( var setModerationStatusCmd = &cobra.Command{ Use: "setModerationStatus", Short: "Set YouTube comments moderation status", - Long: "Set YouTube comments moderation status by IDs", + Long: "Set YouTube comments moderation status by ids", Run: func(cmd *cobra.Command, args []string) { c := comment.NewComment( - comment.WithIDs(IDs), - comment.WithModerationStatus(ModerationStatus), - comment.WithBanAuthor(BanAuthor, true), + comment.WithIDs(ids), + comment.WithModerationStatus(moderationStatus), + comment.WithBanAuthor(banAuthor, true), ) c.SetModerationStatus(false) }, @@ -22,9 +22,9 @@ var setModerationStatusCmd = &cobra.Command{ func init() { commentCmd.AddCommand(setModerationStatusCmd) - setModerationStatusCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments") + setModerationStatusCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments") setModerationStatusCmd.Flags().StringVarP( - &ModerationStatus, "moderationStatus", "s", "", "heldForReview, published or rejected", + &moderationStatus, "moderationStatus", "s", "", "heldForReview, published or rejected", ) - setModerationStatusCmd.Flags().BoolVarP(&BanAuthor, "banAuthor", "b", false, "true or false") + setModerationStatusCmd.Flags().BoolVarP(&banAuthor, "banAuthor", "b", false, "true or false") }