git » chasquid » commit 644cd63

sts: Use keyed fields in io.LimitedReader literal

author Alberto Bertogli
2018-07-14 09:23:36 UTC
committer Alberto Bertogli
2018-07-14 09:23:36 UTC
parent 770a618c84dcc245ce5bd75e67acbb229acb532f

sts: Use keyed fields in io.LimitedReader literal

Flagged by go vet:
internal/sts/sts.go:256: io.LimitedReader composite literal uses unkeyed fields

internal/sts/sts.go +1 -1

diff --git a/internal/sts/sts.go b/internal/sts/sts.go
index 6e59911..b329182 100644
--- a/internal/sts/sts.go
+++ b/internal/sts/sts.go
@@ -253,7 +253,7 @@ func httpGet(ctx context.Context, url string) ([]byte, error) {
 
 	// Read but up to 10k; policies should be way smaller than that, and
 	// having a limit prevents abuse/accidents with very large replies.
-	return ioutil.ReadAll(&io.LimitedReader{resp.Body, 10 * 1024})
+	return ioutil.ReadAll(&io.LimitedReader{R: resp.Body, N: 10 * 1024})
 }
 
 var errRejectRedirect = errors.New("redirects not allowed in MTA-STS")