enable full linter across the codebase (#9620)

enable linter using golangci-lint across
codebase to run a bunch of linters together,
we shall enable new linters as we fix more
things the codebase.

This PR fixes the first stage of this
cleanup.
This commit is contained in:
Harshavardhana
2020-05-18 09:59:45 -07:00
committed by GitHub
parent 96009975d6
commit 1bc32215b9
39 changed files with 128 additions and 239 deletions

View File

@@ -46,13 +46,14 @@ const (
letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits
)
// different kinds of test failures
const (
PASS = "PASS" // Indicate that a test passed
FAIL = "FAIL" // Indicate that a test failed
NA = "NA" // Indicate that a test is not applicable
)
type ErrorResponse struct {
type errorResponse struct {
XMLName xml.Name `xml:"Error" json:"-"`
Code string
Message string
@@ -250,7 +251,7 @@ func testPresignedPutInvalidHash(s3Client *s3.S3) {
defer resp.Body.Close()
dec := xml.NewDecoder(resp.Body)
errResp := ErrorResponse{}
errResp := errorResponse{}
err = dec.Decode(&errResp)
if err != nil {
failureLog(function, args, startTime, "", "AWS SDK Go unmarshalling xml failed", err).Fatal()

View File

@@ -53,19 +53,19 @@ func main() {
testTLSEllipticCurves(endpoint)
}
// Tests whether the endpoint accepts SSL3.0, TLS1.0 or TLS1.1 connections - fail if so.
// Tests whether the endpoint accepts TLS1.0 or TLS1.1 connections - fail if so.
// Tests whether the endpoint accepts TLS1.2 connections - fail if not.
func testTLSVersions(endpoint string) {
const function = "TLSVersions"
startTime := time.Now()
// Tests whether the endpoint accepts SSL3.0, TLS1.0 or TLS1.1 connections
// Tests whether the endpoint accepts TLS1.0 or TLS1.1 connections
args := map[string]interface{}{
"MinVersion": "tls.VersionSSL30",
"MinVersion": "tls.VersionTLS10",
"MaxVersion": "tls.VersionTLS11",
}
_, err := tls.Dial("tcp", endpoint, &tls.Config{
MinVersion: tls.VersionSSL30,
MinVersion: tls.VersionTLS10,
MaxVersion: tls.VersionTLS11,
})
if err == nil {