Skip to content

Commit

Permalink
feat: bump minimum go version to 1.18 (#177)
Browse files Browse the repository at this point in the history
This commit modifies the project so that our mininum
supported version of Go is now 1.18.
As part of this commit, I also removed the v5
directory and moved its contents up to the project root.
This should simplify things a bit and won't affect users
at all.

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
  • Loading branch information
padamstx committed Feb 24, 2023
1 parent c764011 commit 4648b07
Show file tree
Hide file tree
Showing 63 changed files with 191 additions and 159 deletions.
148 changes: 74 additions & 74 deletions .secrets.baseline

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ language: go
dist: bionic

go:
- '1.16.x'
- '1.17.x'
- '1.18.x'
- '1.19.x'
- '1.20.x'

notifications:
email: false
Expand All @@ -19,11 +18,13 @@ before_install:
- sudo apt-get update

install:
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.49.0
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2
- curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

script:
- make all
- make tidy
- make test
- make lint
- make scan-gosec

before_deploy:
Expand All @@ -36,5 +37,5 @@ deploy:
script: npm run semantic-release
skip_cleanup: true
on:
go: '1.16.x'
go: '1.18.x'
branch: main
36 changes: 27 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Here are some examples of acceptable commit messages, along with the release typ
# Pull Requests

If you want to contribute to the repository, here's a quick guide:
1. Fork the repository
1. Fork the repository
- If you have "write" access to the repository, you can avoid using a fork.

2. The `go-sdk-core` project uses Go modules for dependency management, so do NOT set the `GOPATH` environment
variable to include your local `go-sdk-core` project directory.
Expand All @@ -30,17 +31,28 @@ If you want to contribute to the repository, here's a quick guide:

4. Install the `golangci-lint` tool:
```sh
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.31.0
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2
```
* Note: As of this writing, the 1.31.0 version of `golangci-lint` is being used by this project.
* Note: As of this writing, the 1.51.2 version of `golangci-lint` is being used by this project.
Please check the `curl` command found in the `.travis.yml` file to see the version of this tool that is currently
being used at the time you are planning to commit changes. This will ensure that you are using the same version
of the linter as the Travis build automation, which will ensure that you are using the same set of linter checks
that the automated build uses.

5. Make your code changes as needed. Be sure to add new tests for any new or modified functionality.
5. Install the `gosec` tool:
```sh
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
```

6. Make sure that you have a clean "baseline" to work from by building/testing the project before
you start to make changes:
```sh
make all
```

7. Make your code changes as needed. Be sure to add new tests for any new or modified functionality.

6. Test your changes:
8. Test your changes:
```sh
make test
```
Expand All @@ -55,19 +67,25 @@ If you want to contribute to the repository, here's a quick guide:
go test -tags=retries
```
7. Check your code for lint issues:
9. Check your code for lint issues:
```sh
make lint
```

8. Alternatively, to build, test and lint check in one step:
10. To build, test and lint check in one step:
```sh
make all
```
9. Commit your changes:

11. Make sure there are no security vulnerabilities by running `gosec`:
```sh
make scan-gosec
```

12. Commit your changes:
* Commit messages should follow the Angular commit message guidelines as mentioned above.

10. Push your commit(s) to your fork and submit a pull request to the **main** branch.
13. Push your branch to remote and submit a pull request to the **main** branch.

# Developer's Certificate of Origin 1.1

Expand Down
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ GO=go
LINT=golangci-lint
GOSEC=gosec

VDIR=v5

COV_OPTS=-coverprofile=coverage.txt -covermode=atomic

all: testcov lint tidy
all: tidy test lint

testcov:
cd ${VDIR} && ${GO} test -tags=all ${COV_OPTS} ./...
${GO} test -tags=all ${COV_OPTS} ./...

test:
cd ${VDIR} && ${GO} test -tags=all ./...
${GO} test -tags=all ./...

lint:
cd ${VDIR} && ${LINT} run --build-tags=all
${LINT} run --build-tags=all

scan-gosec:
cd ${VDIR} && ${GOSEC} ./...
${GOSEC} ./...

tidy:
cd ${VDIR} && ${GO} mod tidy
${GO} mod tidy
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ go get -u github.com/IBM/go-sdk-core/...
```

## Prerequisites
- Go version 1.16 or newer
- Go version 1.18 or newer

## Authentication
The go-sdk-core project supports the following types of authentication:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion v5/core/utils.go → core/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"time"

"github.com/go-openapi/strfmt"
validator "gopkg.in/go-playground/validator.v9"
validator "github.com/go-playground/validator/v10"
)

// Validate is a shared validator instance used to perform validation of structs.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module github.com/IBM/go-sdk-core/v5

go 1.18

require (
github.com/go-openapi/strfmt v0.21.3
github.com/go-playground/validator/v10 v10.11.2
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.1
github.com/stretchr/testify v1.8.1
)

require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.11.2 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 4648b07

Please sign in to comment.