Skip to content

Commit 96a0a12

Browse files
Drop Go 1.18 and add Go 1.20 (#730)
* drop Go 1.18 and add Go 1.20 * remove unused mimeType * update static check
1 parent ccd4d30 commit 96a0a12

8 files changed

+13
-31
lines changed

.github/workflows/build-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
cloud: [ 'AWS', 'AZURE', 'GCP' ]
29-
go: [ '1.19', '1.18' ]
29+
go: [ '1.20', '1.19' ]
3030
name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Ubuntu
3131
steps:
3232
- uses: actions/checkout@v1
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
matrix:
5050
cloud: [ 'AWS', 'AZURE', 'GCP' ]
51-
go: [ '1.19', '1.18' ]
51+
go: [ '1.20', '1.19' ]
5252
name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Mac
5353
steps:
5454
- uses: actions/checkout@v1
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
matrix:
7272
cloud: [ 'AWS', 'AZURE', 'GCP' ]
73-
go: [ '1.19', '1.18' ]
73+
go: [ '1.20', '1.19' ]
7474
name: ${{ matrix.cloud }} Go ${{ matrix.go }} on Windows
7575
steps:
7676
- uses: actions/checkout@v1

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following software packages are required to use the Go Snowflake Driver.
1818

1919
## Go
2020

21-
The latest driver requires the [Go language](https://golang.org/) 1.18 or higher. The supported operating systems are Linux, Mac OS, and Windows, but you may run the driver on other platforms if the Go language works correctly on those platforms.
21+
The latest driver requires the [Go language](https://golang.org/) 1.19 or higher. The supported operating systems are Linux, Mac OS, and Windows, but you may run the driver on other platforms if the Go language works correctly on those platforms.
2222

2323

2424
# Installation

ci/build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ IF !ERRORLEVEL! NEQ 0 go install golang.org/x/lint/golint@latest
99
where make2help
1010
IF !ERRORLEVEL! NEQ 0 go install github.com/Songmu/make2help/cmd/make2help@latest
1111
where staticcheck
12-
IF !ERRORLEVEL! NEQ 0 go install honnef.co/go/tools/cmd/staticcheck@v0.3
12+
IF !ERRORLEVEL! NEQ 0 go install honnef.co/go/tools/cmd/staticcheck@v0.4
1313

1414
echo [INFO] Go mod
1515
go mod tidy

driver_ocsp_test.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"database/sql"
88
"net/url"
99
"os"
10-
"runtime"
1110
"strings"
1211
"testing"
1312
"time"
@@ -672,14 +671,11 @@ func TestExpiredCertificate(t *testing.T) {
672671
t.Fatalf("failed to extract error URL Error: %v", err)
673672
}
674673
_, ok = urlErr.Err.(x509.CertificateInvalidError)
674+
675675
if !ok {
676-
if runtime.GOOS == "darwin" {
677-
// Go 1.18 on Mac: errors.errorString is thrown
678-
errString := urlErr.Err.Error()
679-
if !strings.HasPrefix(errString, "x509:") || !strings.HasSuffix(errString, "certificate is expired") {
680-
t.Fatalf("failed to extract error Certificate error: %v", err)
681-
}
682-
} else {
676+
// Go 1.20 throws tls CertificateVerification error
677+
errString := urlErr.Err.Error()
678+
if !strings.Contains(errString, "certificate has expired or is not yet valid") {
683679
t.Fatalf("failed to extract error Certificate error: %v", err)
684680
}
685681
}

driver_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ func invalidUserPassErrorTests(invalidDNS string, t *testing.T) {
376376

377377
func TestBogusHostNameParameters(t *testing.T) {
378378
invalidDNS := fmt.Sprintf("%s:%s@%s", username, pass, "INVALID_HOST:1234")
379-
invalidHostErrorTests(invalidDNS, []string{"no such host", "verify account name is correct", "HTTP Status: 403", "Temporary failure in name resolution"}, t)
379+
invalidHostErrorTests(invalidDNS, []string{"no such host", "verify account name is correct", "HTTP Status: 403", "Temporary failure in name resolution", "server misbehaving"}, t)
380380
invalidDNS = fmt.Sprintf("%s:%s@%s", username, pass, "INVALID_HOST")
381-
invalidHostErrorTests(invalidDNS, []string{"read: connection reset by peer", "EOF", "verify account name is correct", "HTTP Status: 403", "Temporary failure in name resolution"}, t)
381+
invalidHostErrorTests(invalidDNS, []string{"read: connection reset by peer", "EOF", "verify account name is correct", "HTTP Status: 403", "Temporary failure in name resolution", "server misbehaving"}, t)
382382
}
383383

384384
func invalidHostErrorTests(invalidDNS string, mstr []string, t *testing.T) {

file_compression_type.go

-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
type compressionType struct {
1313
name string
1414
fileExtension string
15-
mimeType string
1615
mimeSubtypes []string
1716
isSupported bool
1817
}
@@ -21,91 +20,78 @@ var compressionTypes = map[string]*compressionType{
2120
"GZIP": {
2221
"GZIP",
2322
".gz",
24-
"application",
2523
[]string{"gzip", "x-gzip"},
2624
true,
2725
},
2826
"DEFLATE": {
2927
"DEFLATE",
3028
".deflate",
31-
"application",
3229
[]string{"zlib", "deflate"},
3330
true,
3431
},
3532
"RAW_DEFLATE": {
3633
"RAW_DEFLATE",
3734
".raw_deflate",
38-
"application",
3935
[]string{"raw_deflate"},
4036
true,
4137
},
4238
"BZIP2": {
4339
"BZIP2",
4440
".bz2",
45-
"application",
4641
[]string{"bzip2", "x-bzip2", "x-bz2", "x-bzip", "bz2"},
4742
true,
4843
},
4944
"LZIP": {
5045
"LZIP",
5146
".lz",
52-
"application",
5347
[]string{"lzip", "x-lzip"},
5448
false,
5549
},
5650
"LZMA": {
5751
"LZMA",
5852
".lzma",
59-
"application",
6053
[]string{"lzma", "x-lzma"},
6154
false,
6255
},
6356
"LZO": {
6457
"LZO",
6558
".lzo",
66-
"application",
6759
[]string{"lzo", "x-lzo"},
6860
false,
6961
},
7062
"XZ": {
7163
"XZ",
7264
".xz",
73-
"application",
7465
[]string{"xz", "x-xz"},
7566
false,
7667
},
7768
"COMPRESS": {
7869
"COMPRESS",
7970
".Z",
80-
"application",
8171
[]string{"compress", "x-compress"},
8272
false,
8373
},
8474
"PARQUET": {
8575
"PARQUET",
8676
".parquet",
87-
"snowflake",
8877
[]string{"parquet"},
8978
true,
9079
},
9180
"ZSTD": {
9281
"ZSTD",
9382
".zst",
94-
"application",
9583
[]string{"zstd", "x-zstd"},
9684
true,
9785
},
9886
"BROTLI": {
9987
"BROTLI",
10088
".br",
101-
"application",
10289
[]string{"br", "x-br"},
10390
true,
10491
},
10592
"ORC": {
10693
"ORC",
10794
".orc",
108-
"snowflake",
10995
[]string{"orc"},
11096
true,
11197
},

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/snowflakedb/gosnowflake
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/99designs/keyring v1.2.1

gosnowflake.mak

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
55
setup:
66
@which golint &> /dev/null || go install golang.org/x/lint/golint@latest
77
@which make2help &> /dev/null || go install github.com/Songmu/make2help/cmd/make2help@latest
8-
@which staticcheck &> /dev/null || go install honnef.co/go/tools/cmd/staticcheck@v0.3
8+
@which staticcheck &> /dev/null || go install honnef.co/go/tools/cmd/staticcheck@v0.4
99

1010
## Install dependencies
1111
deps: setup

0 commit comments

Comments
 (0)