Skip to content

Commit

Permalink
* [chore]: refactor code and remove unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Jun 13, 2024
1 parent a8a6471 commit ddbed3c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module github.com/easysoft/gitfox-webhooks

go 1.22.4

require github.com/davecgh/go-spew v1.1.1
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit ddbed3c

Please sign in to comment.