From 69782a7735a849f99456a9942254ceb65f173a03 Mon Sep 17 00:00:00 2001 From: Alaric Whitney Date: Thu, 18 Aug 2022 12:01:00 -0500 Subject: [PATCH] Adding Go Modules and Adding Go 1.19 compatibility --- .github/workflows/test-and-deploy.yml | 2 +- .gitignore | 3 ++- README.md | 2 +- go.mod | 3 +++ smtpapi_test.go | 5 ++--- 5 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 go.mod diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 09329bf..dc90f51 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - go: [ '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17' ] + go: [ '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19' ] steps: - name: Checkout smtpapi-go uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index c9eea9b..f5ba7fc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ *.out .DS_Store -.env \ No newline at end of file +.env +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 93fbc97..346231c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ All the updates to this library are documented in our [CHANGELOG](CHANGELOG.md). ## Supported Versions -* Go version 1.11-1.17 +* Go version 1.11-1.19 ## Prerequisites diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..90f37ee --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/sendgrid/smtpapi-go + +go 1.11 diff --git a/smtpapi_test.go b/smtpapi_test.go index ebc73de..05421eb 100644 --- a/smtpapi_test.go +++ b/smtpapi_test.go @@ -3,7 +3,6 @@ package smtpapi import ( "encoding/json" "fmt" - "io/ioutil" "os" "reflect" "regexp" @@ -12,7 +11,7 @@ import ( ) func exampleJson() map[string]interface{} { - data, _ := ioutil.ReadFile("smtpapi_test_strings.json") + data, _ := os.ReadFile("smtpapi_test_strings.json") var f interface{} json.Unmarshal(data, &f) json := f.(map[string]interface{}) @@ -384,7 +383,7 @@ func TestRepoFiles(t *testing.T) { func TestLicenseYear(t *testing.T) { t.Parallel() - dat, err := ioutil.ReadFile("LICENSE") + dat, err := os.ReadFile("LICENSE") currentYear := time.Now().Year() r := fmt.Sprintf("%d", currentYear)