From 52eacbaecb09126f47266e937f6d56792ea1b46d Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Wed, 20 Dec 2023 10:18:28 +0800 Subject: [PATCH] feat: remove gen.go --- gen.go | 45 --------------------------------------------- go.mod | 5 +++-- go.sum | 5 +++++ goreleaser.yml | 29 +++++------------------------ 4 files changed, 13 insertions(+), 71 deletions(-) delete mode 100644 gen.go diff --git a/gen.go b/gen.go deleted file mode 100644 index a8b0b14c..00000000 --- a/gen.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build ignore - -package main - -import ( - "fmt" - "io/ioutil" - "os" -) - -var debugShim string = `package main - -import "net/http" - -func init() { - - notSupport := func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("not support")) - } - - http.HandleFunc("/debug/charts/", notSupport) - http.HandleFunc("/debug/charts/data", notSupport) - http.HandleFunc("/debug/charts/data-feed", notSupport) -} -` -var debug string = `package main - -import ( - _ "github.com/mkevac/debugcharts" -) -` - -func main() { - if len(os.Args) < 2 { - fmt.Println("usage: go run gen.go ") - os.Exit(1) - } - var content string - if os.Args[1] == "1" { - content = debug - } else { - content = debugShim - } - ioutil.WriteFile("debug.go", []byte(content), 0666) -} diff --git a/go.mod b/go.mod index 631827e7..c50c9766 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.20 require ( go.uber.org/zap v1.26.0 - m7s.live/engine/v4 v4.14.6-0.20231215101010-5e3008f00beb - m7s.live/plugin/debug/v4 v4.0.1 + m7s.live/engine/v4 v4.14.6-0.20231220021402-453ea6a6f244 + m7s.live/plugin/debug/v4 v4.0.2-0.20231220021419-8560e3adc2d2 m7s.live/plugin/fmp4/v4 v4.0.5 m7s.live/plugin/gb28181/v4 v4.4.4-0.20231212111848-bee261a67086 m7s.live/plugin/hdl/v4 v4.1.10 @@ -47,6 +47,7 @@ require ( github.com/golang/mock v1.6.0 // indirect github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8 // indirect github.com/google/uuid v1.4.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect github.com/husanpao/ip v0.0.0-20220711082147-73160bb611a8 // indirect github.com/logrusorgru/aurora/v4 v4.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect diff --git a/go.sum b/go.sum index 62aa59ca..7858f466 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/husanpao/ip v0.0.0-20220711082147-73160bb611a8 h1:4Jk58quTZmzJcTrLlbB5L1Q6qXu49EIjCReWxcBFWKo= @@ -456,8 +457,12 @@ m7s.live/engine/v4 v4.14.6-0.20231214060627-b486af848404 h1:dwjYbGgoL0Rvqac/N9bI m7s.live/engine/v4 v4.14.6-0.20231214060627-b486af848404/go.mod h1:FRtMPBGzNE6kCLgY0wuS3H7d1btKocRiVe9fAkDtP1g= m7s.live/engine/v4 v4.14.6-0.20231215101010-5e3008f00beb h1:T35bQ5W2R0b7TMUxsY260UmHJ2C6yDiQyb0CcflY7LE= m7s.live/engine/v4 v4.14.6-0.20231215101010-5e3008f00beb/go.mod h1:FRtMPBGzNE6kCLgY0wuS3H7d1btKocRiVe9fAkDtP1g= +m7s.live/engine/v4 v4.14.6-0.20231220021402-453ea6a6f244 h1:9sCtX8OiQJayEczhp8ggBDiHf2jkxDlVH0qNScEW1Lo= +m7s.live/engine/v4 v4.14.6-0.20231220021402-453ea6a6f244/go.mod h1:FRtMPBGzNE6kCLgY0wuS3H7d1btKocRiVe9fAkDtP1g= m7s.live/plugin/debug/v4 v4.0.1 h1:sX0UADsiikwSol8qx+8aQzGeaFa8yJFa/cUKpBs5Lzw= m7s.live/plugin/debug/v4 v4.0.1/go.mod h1:A/C1ViacCOK7EPeeCfiwlUrC2TUtRdEqzrR0Yd9b1KQ= +m7s.live/plugin/debug/v4 v4.0.2-0.20231220021419-8560e3adc2d2 h1:gSkJ5fz9sV0UGcKVegdKqKELp59xJy6ONL7hKhpd/bg= +m7s.live/plugin/debug/v4 v4.0.2-0.20231220021419-8560e3adc2d2/go.mod h1:muzikl1KrHfbT/+2aHzKg9qDGfpArViQAtpcfFrST88= m7s.live/plugin/fmp4/v4 v4.0.5 h1:0madI/TKvrLkYVAKuPK1HBvbVf0RJg0g2WruET3S+9c= m7s.live/plugin/fmp4/v4 v4.0.5/go.mod h1:4ShxA9Ud2LeYZ/xQaPTWEVfjpK844ijoXxLqhCA607A= m7s.live/plugin/gb28181/v4 v4.4.4-0.20231208110443-ce4946368990 h1:yq4wzL55nbk4x/6ET4d2CZ4eCJuEKevLs98Cm+D+0b8= diff --git a/goreleaser.yml b/goreleaser.yml index f2d53819..66efe3f4 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -6,37 +6,18 @@ archives: - favicon.ico - conf-example/* builds: - - id: "with-debug" - env: [CGO_ENABLED=0] - ldflags: - - -s -w -X main.version={{.Tag}} - ignore: - - goos: darwin - goarch: arm64 - - goos: windows - goarch: arm64 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - hooks: - pre: - - bash -c "debug=1 go generate ./..." - - go mod tidy - - - id: "without-debug" - env: [CGO_ENABLED=0] + - id: "all" + env: + - CGO_ENABLED=0 ldflags: - -s -w -X main.version={{.Tag}} goos: + - linux - windows - darwin goarch: - arm64 + - amd64 hooks: pre: - - bash -c "debug=0 go generate ./..." - go mod tidy \ No newline at end of file