print contributor names in alphabetical order

This commit is contained in:
rushtehrani
2020-06-06 14:44:19 -07:00
parent 295a3b9484
commit a30b46dff9

View File

@@ -6,6 +6,7 @@ import (
"flag"
"fmt"
"net/http"
"sort"
"strings"
)
@@ -130,7 +131,13 @@ func printMarkDown(issues []*Issue, version *string) {
}
fmt.Println("# Contributors")
for _, user := range contributors {
usernames := make([]string, 0)
for username := range contributors {
usernames = append(usernames, username)
}
sort.Strings(usernames)
for _, username := range usernames {
user := contributors[username]
fmt.Println(fmt.Sprintf("- <a href=\"%s\"><img src=\"%s\" width=\"12\"/> <strong>%s</strong></a> %s", user.URL, user.AvatarURL, user.Login, user.Login))
}
}