mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
fix error check
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
@@ -29,7 +30,14 @@ func main() {
|
|||||||
svg.WriteTo(w)
|
svg.WriteTo(w)
|
||||||
})
|
})
|
||||||
r.HandleFunc("/yearly.svg", func(w http.ResponseWriter, r *http.Request) {
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user