Use gofrs/uuid instead of satori/go.uuid

The satori package appears to be unmaintained.  The gofrs package is a
fork that is actively maintained by a larger group of Go developers.
This commit is contained in:
Cameron Moore 2019-12-18 21:04:35 -06:00
parent 7b87d6092f
commit 8ff3848ea3
16 changed files with 1019 additions and 578 deletions

View file

@ -16,11 +16,9 @@ import (
"time"
"github.com/adnanh/webhook/hook"
"github.com/codegangsta/negroni"
"github.com/gofrs/uuid"
"github.com/gorilla/mux"
uuid "github.com/satori/go.uuid"
fsnotify "gopkg.in/fsnotify.v1"
)
@ -229,7 +227,15 @@ func main() {
func hookHandler(w http.ResponseWriter, r *http.Request) {
// generate a request id for logging
rid := uuid.NewV4().String()[:6]
u, err := uuid.NewV4()
if err != nil {
log.Printf("internal server error: %s", err)
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Internal server error")
return
}
rid := u.String()[:6]
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)