From 80a4c47d622582be1e78a18afc1ec119cdef016c Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 7 Sep 2022 15:15:07 +0200 Subject: [PATCH] Fix lint error regarding struct with unexported fields (#38) Unexported fields are skipped during marshalling, so this would be a nop. The code in `./cmd/sync/github*.go` is currently unused. Confirmed that staticcheck passes when run with: ``` staticcheck -checks SA9005 ./... ``` --- cmd/sync/github.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/sync/github.go b/cmd/sync/github.go index 0dd624da..7edd6644 100644 --- a/cmd/sync/github.go +++ b/cmd/sync/github.go @@ -85,8 +85,8 @@ func githubGetPAT(ctx context.Context) (string, error) { return "", fmt.Errorf("failed to acquire access token: %w", err) } raw, err = json.Marshal(struct { - note string - scopes []string + Note string `json:"note"` + Scopes []string `json:"scopes"` }{"test token", []string{}}) if err != nil { return "", err