Repository: snowflakedb/gosnowflake
Pull request #322 (2020-08-11 23:17:41)

Support Go v1.15
### Description
Please explain the changes you made here.

### Checklist
- [x] Code compiles correctly
- [x] Run ``make fmt`` to fix inconsistent formats
- [x] Run ``make lint`` to get lint errors and fix all of them
- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the README / documentation, if necessary


sfc-gh-stakeda: yup, looks like new errors/warnings are caught. Please fix them and ensure all tests pass.

Patch:
diff --git a/doc.go b/doc.go
index 377b926..2d1cd6a 100644
--- a/doc.go
+++ b/doc.go
@@ -213,7 +213,7 @@ Supported Data Types
 
 Queries return SQL column type information in the ColumnType type. The
 DatabaseTypeName method returns strings representing Snowflake data types.
-The following table shows those strings, the corresponding Snowflake data 
+The following table shows those strings, the corresponding Snowflake data
 type, and the corresponding Golang native data type:
 
 	String Representation	Snowflake Data Type	Golang Data Type
diff --git a/go.mod b/go.mod
index d9f1e59..7e49553 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/snowflakedb/gosnowflake
 
-go 1.14
+go 1.15
 
 require (
 	github.com/apache/arrow/go/arrow v0.0.0-20200601151325-b2287a20f230
diff --git a/ocsp.go b/ocsp.go
index e3bbabe..2bc07e1 100644
--- a/ocsp.go
+++ b/ocsp.go
@@ -494,7 +494,7 @@ func getRevocationStatus(subject, issuer *x509.Certificate) *ocspStatus {
 	headers := make(map[string]string)
 	headers["Content-Type"] = "application/ocsp-request"
 	headers["Accept"] = "application/ocsp-response"
-	headers["Content-Length"] = string(len(ocspReq))
+	headers["Content-Length"] = strconv.Itoa(len(ocspReq))
 	headers["Host"] = hostname
 	timeoutStr := os.Getenv(ocspTestResponderTimeoutEnv)
 	timeout := defaultOCSPResponderTimeout


Test patch:
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index 7515826..30e80f3 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -18,7 +18,7 @@ jobs:
         strategy:
             matrix:
                 cloud: [ 'AWS', 'AZURE', 'GCP' ]
-                go: [ '1.14', '1.13' ]
+                go: [ '1.15', '1.14', '1.13' ]
         name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Ubuntu
         steps:
             - uses: actions/checkout@v1
@@ -42,7 +42,7 @@ jobs:
         strategy:
             matrix:
                 cloud: [ 'AWS', 'AZURE', 'GCP' ]
-                go: [ '1.14', '1.13' ]
+                go: [ '1.15', '1.14', '1.13' ]
         name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Mac
         steps:
             - uses: actions/checkout@v1
@@ -66,7 +66,7 @@ jobs:
         strategy:
             matrix:
                 cloud: [ 'AWS', 'AZURE', 'GCP' ]
-                go: [ '1.14', '1.13' ]
+                go: [ '1.15', '1.14', '1.13' ]
         name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Windows
         steps:
             - uses: actions/checkout@v1
diff --git a/ocsp_test.go b/ocsp_test.go
index 606ab74..8c547b4 100644
--- a/ocsp_test.go
+++ b/ocsp_test.go
@@ -210,25 +210,25 @@ func TestUnitCheckOCSPResponseCache(t *testing.T) {
 		"koRzw/UU7zKsqiTB0ZN/rgJp+MocTdqQSGKvbZyR8d4u8eNQqi1x4Pk3yO/pftANFaJKGB+JPgKS3PQAqJaXcipNcEfqtl7y4PO6kqA" +
 		"Jb4xI/OTXIrRA5TsT4cCioE"
 	// issuer is not a true issuer certificate
-	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime-1000), actualOcspResponse}
+	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime - 1000), actualOcspResponse}
 	ost = checkOCSPResponseCache(&dummyKey, subject, issuer)
 	if ost.code != ocspFailedParseResponse {
 		t.Fatalf("should have failed. expected: %v, got: %v", ocspFailedParseResponse, ost.code)
 	}
 	// invalid validity
-	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime-1000), actualOcspResponse}
+	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime - 1000), actualOcspResponse}
 	ost = checkOCSPResponseCache(&dummyKey, subject, nil)
 	if ost.code != ocspInvalidValidity {
 		t.Fatalf("should have failed. expected: %v, got: %v", ocspInvalidValidity, ost.code)
 	}
 	// wrong timestamp type
-	ocspResponseCache[dummyKey] = []interface{}{uint32(currentTime-1000), 123456}
+	ocspResponseCache[dummyKey] = []interface{}{uint32(currentTime - 1000), 123456}
 	ost = checkOCSPResponseCache(&dummyKey, subject, issuer)
 	if ost.code != ocspFailedDecodeResponse {
 		t.Fatalf("should have failed. expected: %v, got: %v", ocspFailedDecodeResponse, ost.code)
 	}
 	// wrong value type
-	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime-1000), 123456}
+	ocspResponseCache[dummyKey] = []interface{}{float64(currentTime - 1000), 123456}
 	ost = checkOCSPResponseCache(&dummyKey, subject, issuer)
 	if ost.code != ocspFailedDecodeResponse {
 		t.Fatalf("should have failed. expected: %v, got: %v", ocspFailedDecodeResponse, ost.code)