Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: events/codedeploy.go:16:2: SA9004 (staticcheck) #322

Merged
merged 4 commits into from Oct 3, 2020

Conversation

shogo82148
Copy link
Contributor

Issue #, if available:

It fixes the following staticcheck warning.

events/codedeploy.go:16:2: SA9004: only the first constant in this group has an explicit type (staticcheck)
	CodeDeployDeploymentStateFailure CodeDeployDeploymentState = "FAILURE"
	^

The warning is shown because CodeDeployDeploymentState constants have unexpected type.

package main

import (
	"fmt"

	"github.com/aws/aws-lambda-go/events"
)

func main() {
	fmt.Printf("%10[1]s: %[1]T\n", events.CodeDeployDeploymentStateFailure)
	fmt.Printf("%10[1]s: %[1]T\n", events.CodeDeployDeploymentStateReady)
	fmt.Printf("%10[1]s: %[1]T\n", events.CodeDeployDeploymentStateStart)
	fmt.Printf("%10[1]s: %[1]T\n", events.CodeDeployDeploymentStateStop)
	fmt.Printf("%10[1]s: %[1]T\n", events.CodeDeployDeploymentStateSuccess)
}

got:

   FAILURE: events.CodeDeployDeploymentState
     READY: string
     START: string
      STOP: string
   SUCCESS: string

want:

   FAILURE: events.CodeDeployDeploymentState
     READY: events.CodeDeployDeploymentState
     START: events.CodeDeployDeploymentState
      STOP: events.CodeDeployDeploymentState
   SUCCESS: events.CodeDeployDeploymentState

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2020

Codecov Report

Merging #322 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #322   +/-   ##
=======================================
  Coverage   72.46%   72.46%           
=======================================
  Files          18       18           
  Lines         730      730           
=======================================
  Hits          529      529           
  Misses        136      136           
  Partials       65       65           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d520080...61efc90. Read the comment docs.

@bmoffatt bmoffatt merged commit b0cb7b2 into aws:master Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants