mirror of
https://github.com/taigrr/gico.git
synced 2026-04-01 18:58:59 -07:00
fix error check
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
@@ -29,7 +30,14 @@ func main() {
|
||||
svg.WriteTo(w)
|
||||
})
|
||||
r.HandleFunc("/yearly.svg", func(w http.ResponseWriter, r *http.Request) {
|
||||
freq, err := commits.GlobalFrequency(2022, []string{"Groot"})
|
||||
year := time.Now().Year()
|
||||
yst := r.URL.Query().Get("year")
|
||||
author := r.URL.Query().Get("author")
|
||||
y, err := strconv.Atoi(yst)
|
||||
if err == nil {
|
||||
year = y
|
||||
}
|
||||
freq, err := commits.GlobalFrequency(year, []string{author})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user