From 0c674a95576d74a0fabdb06491e6f44a42743ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Tue, 19 Nov 2024 10:41:36 +0800 Subject: [PATCH] strings.Title - strings.ToTitle --- plugins/zltx_card_v1/internal/zltx_card_v1.go | 6 +++--- plugins/zltx_v1/internal/zltx_v1.go | 6 +++--- plugins/zltx_v2/internal/zltx_v2.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/zltx_card_v1/internal/zltx_card_v1.go b/plugins/zltx_card_v1/internal/zltx_card_v1.go index 2363620..7b0c471 100644 --- a/plugins/zltx_card_v1/internal/zltx_card_v1.go +++ b/plugins/zltx_card_v1/internal/zltx_card_v1.go @@ -6,7 +6,7 @@ import ( "encoding/json" "fmt" "gitea.cdlsxd.cn/sdk/plugin/proto" - "io/ioutil" + "io" "net/http" "strings" ) @@ -77,13 +77,13 @@ func (p *ZLTXCardV1Service) Notify(ctx context.Context, request *proto.NotifyReq } newHeaders := make(http.Header) for key, values := range httpHeaders { - newKey := strings.Title(strings.ToLower(key)) + newKey := strings.ToTitle(strings.ToLower(key)) newHeaders[newKey] = values } req := &http.Request{ Header: newHeaders, - Body: ioutil.NopCloser(bytes.NewBuffer(request.Body)), + Body: io.NopCloser(bytes.NewBuffer(request.Body)), } dctW, err := c.dctW() diff --git a/plugins/zltx_v1/internal/zltx_v1.go b/plugins/zltx_v1/internal/zltx_v1.go index b587d42..6701d7c 100644 --- a/plugins/zltx_v1/internal/zltx_v1.go +++ b/plugins/zltx_v1/internal/zltx_v1.go @@ -7,7 +7,7 @@ import ( "fmt" "gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api/direct" "gitea.cdlsxd.cn/sdk/plugin/proto" - "io/ioutil" + "io" "net/http" "strings" ) @@ -85,13 +85,13 @@ func (p *ZLTXV1Service) Notify(ctx context.Context, request *proto.NotifyRequest } newHeaders := make(http.Header) for key, values := range httpHeaders { - newKey := strings.Title(strings.ToLower(key)) + newKey := strings.ToTitle(strings.ToLower(key)) newHeaders[newKey] = values } req := &http.Request{ Header: newHeaders, - Body: ioutil.NopCloser(bytes.NewBuffer(request.Body)), + Body: io.NopCloser(bytes.NewBuffer(request.Body)), } a := &direct.Direct{DctWServer: server} diff --git a/plugins/zltx_v2/internal/zltx_v2.go b/plugins/zltx_v2/internal/zltx_v2.go index 9ee177a..370b3d7 100644 --- a/plugins/zltx_v2/internal/zltx_v2.go +++ b/plugins/zltx_v2/internal/zltx_v2.go @@ -8,7 +8,7 @@ import ( "gitea.cdlsxd.cn/sdk/plugin/proto" "gitee.com/chengdu_blue_brothers/openapi-go-sdk-v2/api" "gitee.com/chengdu_blue_brothers/openapi-go-sdk-v2/notify" - "io/ioutil" + "io" "net/http" "strings" ) @@ -75,11 +75,11 @@ func (p *ZLTXV2Service) Notify(_ context.Context, request *proto.NotifyRequest) } newHeaders := make(http.Header) for key, values := range httpHeaders { - newKey := strings.Title(strings.ToLower(key)) + newKey := strings.ToTitle(strings.ToLower(key)) newHeaders[newKey] = values } req.Header = newHeaders - req.Body = ioutil.NopCloser(bytes.NewBuffer(request.Body)) + req.Body = io.NopCloser(bytes.NewBuffer(request.Body)) c, err := transConfig(request.Config) if err != nil {