-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
provider: Fix updated govet composites and nilness checks #7993
Conversation
Trusty is EOL soon and trying to workaround memory issues: ``` ==> Checking source code against linters... fatal error: runtime: out of memory ```
…iguration by default We may want to wait until staticcheck 2019.1.1: * golangci/golangci-lint#445 * https://github.com/dominikh/go-tools/releases/tag/2019.1.1 Still trying to workaround memory issues in TravisCI: ``` $ make lint ==> Checking source code against linters... fatal error: runtime: out of memory``` ```
@@ -57,14 +58,6 @@ func testSweepGameliftGameSessionQueue(region string) error { | |||
} | |||
} | |||
|
|||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing duplicate logic.
if err != nil { | ||
if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpnConnectionID.NotFound" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acceptance test should fail if this error is returned here.
@@ -374,18 +374,7 @@ func testAccAWSVpnGatewayDisappears(gateway *ec2.VpnGateway) resource.TestCheckF | |||
VpcId: gateway.VpcAttachments[0].VpcId, | |||
}) | |||
if err != nil { | |||
ec2err, ok := err.(awserr.Error) | |||
if ok { | |||
if ec2err.Code() == "InvalidVpnGatewayID.NotFound" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acceptance test should fail if either of these errors are returned here.
@@ -1,34 +1,33 @@ | |||
dist: trusty | |||
dist: xenial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was updated to see if it helped with the memory issue since TravisCI does not start services by default on the newer OS. It didn't make the memory issue disappear, but the update is helpful anyways.
@@ -11,7 +11,6 @@ linters: | |||
- gosimple | |||
- ineffassign | |||
- misspell | |||
- staticcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary for now to fix out of memory issue. We can consider adding a separate TravisCI matrix job, running staticcheck by itself, or waiting for staticcheck
2019.1.1 support in golangci-lint
:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the memory usage difference locally for me:
# golangci-lint on master
6227824640 maximum resident set size
# golangci-lint 1.15.0
5142007808 maximum resident set size
We should also watch: dominikh/go-tools#419
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! golangci/golangci-lint#445 was merged. Also, I've added the section about memory usage into README. You can try to set GOGC=30
for example to trade memory for CPU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @jirfag 😄 This should be a huge help for us.
@@ -58,21 +58,20 @@ func testAccCheckEmrSecurityConfigurationDestroy(s *terraform.State) error { | |||
resp, err := conn.DescribeSecurityConfiguration(&emr.DescribeSecurityConfigurationInput{ | |||
Name: aws.String(rs.Primary.ID), | |||
}) | |||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invert logic here to match preferred style across codebase of error checking first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
References: * #7993 * https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md This installation method allows us to control tooling versions via Go Modules instead of receiving unexpected updates from latest upstream code. We prefer this method over installing binaries from shell scripts and needing to manually manage tooling versions in other ways. We start by pinning golangci-lint@v1.15.0 and misspell@v0.3.4.
References: * https://github.com/golangci/golangci-lint/releases/tag/v1.16.0 * #7993 (comment) Updated via: ```console $ go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 $ go mod tidy $ go mod vendor ```
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #7992
Output from acceptance testing (test failures unrelated):