From 6b8d08d12c33783288050fe92257632d9d4c7c6d Mon Sep 17 00:00:00 2001 From: alejoloaiza Date: Sun, 10 Jun 2018 20:07:37 -0400 Subject: [PATCH] [Update] Fix remaining golint issues reported, should be 100% after this --- examples/goinstaExamples.go | 2 ++ goinsta/cmd/account/feed/root.go | 1 + goinsta/cmd/account/followers/root.go | 1 + goinsta/cmd/account/following/root.go | 1 + goinsta/cmd/account/info/root.go | 1 + goinsta/cmd/account/root.go | 2 ++ goinsta/cmd/account/stories/root.go | 1 + goinsta/cmd/logout/root.go | 1 + goinsta/cmd/root.go | 1 + goinsta/cmd/search/facebook/root.go | 1 + goinsta/cmd/search/root.go | 2 ++ goinsta/cmd/search/tags/root.go | 1 + goinsta/cmd/search/user/root.go | 1 + goinsta/cmd/timeline/feed/root.go | 1 + goinsta/cmd/timeline/root.go | 2 ++ goinsta/cmd/timeline/stories/root.go | 1 + goinsta/cmd/user/block/root.go | 1 + goinsta/cmd/user/feed/root.go | 1 + goinsta/cmd/user/follow/root.go | 1 + goinsta/cmd/user/followers/root.go | 1 + goinsta/cmd/user/following/root.go | 1 + goinsta/cmd/user/highlights/root.go | 1 + goinsta/cmd/user/info/root.go | 1 + goinsta/cmd/user/root.go | 2 ++ goinsta/cmd/user/stories/root.go | 1 + goinsta/cmd/user/unblock/root.go | 1 + goinsta/cmd/user/unfollow/root.go | 1 + 27 files changed, 32 insertions(+) diff --git a/examples/goinstaExamples.go b/examples/goinstaExamples.go index 0878e2c4..3f3d4f12 100644 --- a/examples/goinstaExamples.go +++ b/examples/goinstaExamples.go @@ -9,8 +9,10 @@ import ( "github.com/howeyc/gopass" ) +// UsingSession is used inside InitGoinsta to control if there is already a session created. var UsingSession bool +// CheckErr is a generic function to validate all errors. func CheckErr(err error) { if err != nil { fmt.Printf("error: %s\n", err) diff --git a/goinsta/cmd/account/feed/root.go b/goinsta/cmd/account/feed/root.go index ae87ee54..c103c760 100644 --- a/goinsta/cmd/account/feed/root.go +++ b/goinsta/cmd/account/feed/root.go @@ -24,6 +24,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Feeds. var RootCmd = &cobra.Command{ Use: "feed", Short: "Get downloads all user feed", diff --git a/goinsta/cmd/account/followers/root.go b/goinsta/cmd/account/followers/root.go index bdfd9785..4a674ff3 100644 --- a/goinsta/cmd/account/followers/root.go +++ b/goinsta/cmd/account/followers/root.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Followers. var RootCmd = &cobra.Command{ Use: "followers", Short: "Get account followers", diff --git a/goinsta/cmd/account/following/root.go b/goinsta/cmd/account/following/root.go index 6c30eddd..05e098a6 100644 --- a/goinsta/cmd/account/following/root.go +++ b/goinsta/cmd/account/following/root.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Following contacts. var RootCmd = &cobra.Command{ Use: "following", Short: "Get account following", diff --git a/goinsta/cmd/account/info/root.go b/goinsta/cmd/account/info/root.go index 8c86fefa..d58d7eed 100644 --- a/goinsta/cmd/account/info/root.go +++ b/goinsta/cmd/account/info/root.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Profile info. var RootCmd = &cobra.Command{ Use: "info", Short: "Get partial info about your account", diff --git a/goinsta/cmd/account/root.go b/goinsta/cmd/account/root.go index 839fca31..30d63851 100644 --- a/goinsta/cmd/account/root.go +++ b/goinsta/cmd/account/root.go @@ -40,11 +40,13 @@ func init() { RootCmd.AddCommand(following.RootCmd) } +//RootCmd is used as a command line interaction with Instagram Account related methods. var RootCmd = &cobra.Command{ Use: "account", Short: "Interact with your account", } +//Execute the method to to start the command execution of Instagram Account related methods. func Execute() { if err := RootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/goinsta/cmd/account/stories/root.go b/goinsta/cmd/account/stories/root.go index 7f16012b..4e9271e6 100644 --- a/goinsta/cmd/account/stories/root.go +++ b/goinsta/cmd/account/stories/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Stories. var RootCmd = &cobra.Command{ Use: "stories", Short: "Get stories of your account", diff --git a/goinsta/cmd/logout/root.go b/goinsta/cmd/logout/root.go index e08b0ad2..f57c7538 100644 --- a/goinsta/cmd/logout/root.go +++ b/goinsta/cmd/logout/root.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Logout. var RootCmd = &cobra.Command{ Use: "logout", Short: "Logout from your account", diff --git a/goinsta/cmd/root.go b/goinsta/cmd/root.go index d0e2f035..3b89746b 100644 --- a/goinsta/cmd/root.go +++ b/goinsta/cmd/root.go @@ -49,6 +49,7 @@ var rootCmd = &cobra.Command{ Short: "Command line tool for Instagram", } +// Execute is called from main as an entrance to the command line interaction tool. func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/goinsta/cmd/search/facebook/root.go b/goinsta/cmd/search/facebook/root.go index 31961908..2076ec90 100644 --- a/goinsta/cmd/search/facebook/root.go +++ b/goinsta/cmd/search/facebook/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Facebook Search. var RootCmd = &cobra.Command{ Use: "facebook", Short: "Search facebook users on Instagram", diff --git a/goinsta/cmd/search/root.go b/goinsta/cmd/search/root.go index 4608f183..f2244127 100644 --- a/goinsta/cmd/search/root.go +++ b/goinsta/cmd/search/root.go @@ -36,11 +36,13 @@ func init() { RootCmd.AddCommand(tags.RootCmd) } +//RootCmd is used as a command line interaction with all Instagram Searches. var RootCmd = &cobra.Command{ Use: "search", Short: "Search on Instagram.", } +//Execute the method to to start the command execution of Instagram Search related methods. func Execute() { if err := RootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/goinsta/cmd/search/tags/root.go b/goinsta/cmd/search/tags/root.go index 2483332c..0a3a96c3 100644 --- a/goinsta/cmd/search/tags/root.go +++ b/goinsta/cmd/search/tags/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Tag search. var RootCmd = &cobra.Command{ Use: "tags", Short: "Search tags on Instagram", diff --git a/goinsta/cmd/search/user/root.go b/goinsta/cmd/search/user/root.go index 56a8a442..b39fd765 100644 --- a/goinsta/cmd/search/user/root.go +++ b/goinsta/cmd/search/user/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram User Search. var RootCmd = &cobra.Command{ Use: "user", Short: "Search users on Instagram", diff --git a/goinsta/cmd/timeline/feed/root.go b/goinsta/cmd/timeline/feed/root.go index 91f92e14..26a54b67 100644 --- a/goinsta/cmd/timeline/feed/root.go +++ b/goinsta/cmd/timeline/feed/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Timeline Feed. var RootCmd = &cobra.Command{ Use: "feed", Short: "Download feed media", diff --git a/goinsta/cmd/timeline/root.go b/goinsta/cmd/timeline/root.go index e7675d3e..53098fcd 100644 --- a/goinsta/cmd/timeline/root.go +++ b/goinsta/cmd/timeline/root.go @@ -34,11 +34,13 @@ func init() { RootCmd.AddCommand(stories.RootCmd) } +//RootCmd is used as a command line interaction with Instagram Timeline related methods. var RootCmd = &cobra.Command{ Use: "timeline", Short: "Get timeline feed or stories", } +//Execute the method to to start the command execution of Instagram Timeline related methods. func Execute() { if err := RootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/goinsta/cmd/timeline/stories/root.go b/goinsta/cmd/timeline/stories/root.go index f8b68b61..5e65c3c9 100644 --- a/goinsta/cmd/timeline/stories/root.go +++ b/goinsta/cmd/timeline/stories/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Timeline Stories. var RootCmd = &cobra.Command{ Use: "stories", Short: "Get stories of a user", diff --git a/goinsta/cmd/user/block/root.go b/goinsta/cmd/user/block/root.go index f986d772..9fcfdb40 100644 --- a/goinsta/cmd/user/block/root.go +++ b/goinsta/cmd/user/block/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Block user method. var RootCmd = &cobra.Command{ Use: "block", Short: "Blocks a user", diff --git a/goinsta/cmd/user/feed/root.go b/goinsta/cmd/user/feed/root.go index ae87ee54..8c1b8483 100644 --- a/goinsta/cmd/user/feed/root.go +++ b/goinsta/cmd/user/feed/root.go @@ -24,6 +24,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram user Feed method. var RootCmd = &cobra.Command{ Use: "feed", Short: "Get downloads all user feed", diff --git a/goinsta/cmd/user/follow/root.go b/goinsta/cmd/user/follow/root.go index 5792660a..a967a563 100644 --- a/goinsta/cmd/user/follow/root.go +++ b/goinsta/cmd/user/follow/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram Follow user method. var RootCmd = &cobra.Command{ Use: "follow", Short: "Start following a user", diff --git a/goinsta/cmd/user/followers/root.go b/goinsta/cmd/user/followers/root.go index 1b40e2fa..d080117b 100644 --- a/goinsta/cmd/user/followers/root.go +++ b/goinsta/cmd/user/followers/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram get followers method. var RootCmd = &cobra.Command{ Use: "followers", Short: "Get user followers", diff --git a/goinsta/cmd/user/following/root.go b/goinsta/cmd/user/following/root.go index f326485e..637fdbaf 100644 --- a/goinsta/cmd/user/following/root.go +++ b/goinsta/cmd/user/following/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram get user following method. var RootCmd = &cobra.Command{ Use: "following", Short: "Get user following", diff --git a/goinsta/cmd/user/highlights/root.go b/goinsta/cmd/user/highlights/root.go index 375f1be4..f623a0cd 100644 --- a/goinsta/cmd/user/highlights/root.go +++ b/goinsta/cmd/user/highlights/root.go @@ -30,6 +30,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram get user highlight methods. var RootCmd = &cobra.Command{ Use: "highlights", Short: "Get highlights of a user", diff --git a/goinsta/cmd/user/info/root.go b/goinsta/cmd/user/info/root.go index b84dd06a..ed59d9fa 100644 --- a/goinsta/cmd/user/info/root.go +++ b/goinsta/cmd/user/info/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram get user info method. var RootCmd = &cobra.Command{ Use: "info", Short: "Get partial info about user", diff --git a/goinsta/cmd/user/root.go b/goinsta/cmd/user/root.go index ebade545..00552121 100644 --- a/goinsta/cmd/user/root.go +++ b/goinsta/cmd/user/root.go @@ -50,11 +50,13 @@ func init() { RootCmd.AddCommand(unblock.RootCmd) } +//RootCmd is used as a command line interaction with Instagram User related methods. var RootCmd = &cobra.Command{ Use: "user", Short: "Get downloads specified Instagram user's object.", } +//Execute the method to to start the command execution of Instagram User related methods. func Execute() { if err := RootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/goinsta/cmd/user/stories/root.go b/goinsta/cmd/user/stories/root.go index 40fd0fd4..17d1a533 100644 --- a/goinsta/cmd/user/stories/root.go +++ b/goinsta/cmd/user/stories/root.go @@ -30,6 +30,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram get user stories method. var RootCmd = &cobra.Command{ Use: "stories", Short: "Get stories of a user", diff --git a/goinsta/cmd/user/unblock/root.go b/goinsta/cmd/user/unblock/root.go index 8390a931..0319e8b7 100644 --- a/goinsta/cmd/user/unblock/root.go +++ b/goinsta/cmd/user/unblock/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram unblock user method. var RootCmd = &cobra.Command{ Use: "unblock", Short: "Unblocks a user", diff --git a/goinsta/cmd/user/unfollow/root.go b/goinsta/cmd/user/unfollow/root.go index 47c9d368..e81b60cd 100644 --- a/goinsta/cmd/user/unfollow/root.go +++ b/goinsta/cmd/user/unfollow/root.go @@ -28,6 +28,7 @@ import ( "github.com/spf13/cobra" ) +//RootCmd is used as a command line interaction with Instagram unfollow user method. var RootCmd = &cobra.Command{ Use: "unfollow", Short: "Start unfollowing a user",