Skip to content

Commit

Permalink
Unnecessary else block is necessary. See fca329
Browse files Browse the repository at this point in the history
  • Loading branch information
gkze committed Dec 11, 2018
1 parent 82afeff commit fcc595c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ USAGE:
stars [global options] command [command options] [arguments...]

VERSION:
0.3.8
0.3.9

COMMANDS:
save Save all stars
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
cmdline := cli.NewApp()
cmdline.Name = "stars"
cmdline.Usage = "Command-line interface to YOUR GitHub stars"
cmdline.Version = "0.3.8"
cmdline.Version = "0.3.9"
cmdline.Commands = []cli.Command{
{
Name: "save",
Expand Down
4 changes: 2 additions & 2 deletions starmanager/starmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ func (s *StarManager) GetProjects(count int, language, topic string, random bool
rand.Shuffle(len(stars), func(i, j int) {
stars[i], stars[j] = stars[j], stars[i]
})
} else {
sort.Slice(stars, func(i, j int) bool { return stars[i].Stargazers > stars[j].Stargazers })
}

sort.Slice(stars, func(i, j int) bool { return stars[i].Stargazers > stars[j].Stargazers })

if len(stars) > 0 {
if len(stars) > count {
return stars[0:count], nil
Expand Down

0 comments on commit fcc595c

Please sign in to comment.