From 42434250b57ae1ae45a5bddf08a2c5f0100f63f7 Mon Sep 17 00:00:00 2001 From: Kazuhito NAKAMURA Date: Wed, 28 Jun 2023 09:54:01 +0900 Subject: [PATCH] align argument names to the interface definition --- sigv4.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sigv4.go b/sigv4.go index ac8eb34..79b0bfe 100644 --- a/sigv4.go +++ b/sigv4.go @@ -29,21 +29,21 @@ type _signer struct { creds *aws.Credentials } -func (s *_signer) signHTTP(body []byte) (http.Header, error) { - req, err := http.NewRequest("POST", s.url, bytes.NewBuffer(body)) +func (s *_signer) signHTTP(payload []byte) (http.Header, error) { + req, err := http.NewRequest("POST", s.url, bytes.NewBuffer(payload)) if err != nil { log.Println(err) return nil, err } switch signer := s.sdkSigner.(type) { case *sdkv1_v4.Signer: - _, err = signer.Sign(req, bytes.NewReader(body), "appsync", s.region, time.Now()) + _, err = signer.Sign(req, bytes.NewReader(payload), "appsync", s.region, time.Now()) if err != nil { log.Println(err) return nil, err } case *sdkv2_v4.Signer: - hash := sha256.Sum256(body) + hash := sha256.Sum256(payload) if err := signer.SignHTTP(context.TODO(), *s.creds, req, hex.EncodeToString(hash[:]), "appsync", s.region, time.Now()); err != nil { log.Println(err) return nil, err