From ddbed3cb167b718535e21e5a22d43ea3301c85e5 Mon Sep 17 00:00:00 2001 From: ysicing Date: Thu, 13 Jun 2024 14:52:25 +0800 Subject: [PATCH] * [chore]: refactor code and remove unused packages --- example/example.go | 6 ------ go.mod | 2 -- go.sum | 2 -- 3 files changed, 10 deletions(-) diff --git a/example/example.go b/example/example.go index 2ecb9cf..4ce0c4c 100644 --- a/example/example.go +++ b/example/example.go @@ -7,20 +7,14 @@ package main import ( - "io" "log" "net/http" "github.com/easysoft/gitfox-webhooks/gitfox" - - "github.com/davecgh/go-spew/spew" ) // 接受所有webhook请求,并打印请求内容 func webhookHandler(w http.ResponseWriter, r *http.Request) { - body, _ := io.ReadAll(r.Body) - log.Printf("request body: %s", body) - spew.Dump(r.Header) hook, _ := gitfox.New() payload, err := hook.Parse(r, gitfox.BranchCreatedEvent, gitfox.BranchUpdatedEvent, gitfox.BranchDeletedEvent, diff --git a/go.mod b/go.mod index ca71520..598f36e 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,3 @@ module github.com/easysoft/gitfox-webhooks go 1.22.4 - -require github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index b5e2922..e69de29 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=