-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. add how to resolve problems with old version of dependencies
- Loading branch information
Showing
7 changed files
with
74 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,7 @@ func (r *repo) Save(ctx context.Context, u *user) error { | |
### Requirements | ||
|
||
- [golangci-lint](https://golangci-lint.run/welcome/install/) | ||
- [make](https://www.gnu.org/software/make/#download) | ||
|
||
### Local Running | ||
|
||
|
@@ -198,16 +199,29 @@ go install go1.16 # or older version | |
go1.16 install | ||
``` | ||
|
||
To run some tests | ||
Use `-mod=readonly` to prevent `go.mod` modification. | ||
|
||
To run tests | ||
``` | ||
go1.16 test -race -mod=readonly ./... | ||
``` | ||
|
||
To build `go.mod` compatible for old version use `go mod tidy -compat=1.13` ([docs](https://go.dev/ref/mod#go-mod-tidy)). | ||
|
||
### How to bump up Golang version in CI/CD | ||
|
||
1. Changes in [.github/workflows/main.yaml](.github/workflows/main.yaml). | ||
1. Add all old version of Go in `go-version:` for `tests-units` job. | ||
2. Update `go-version:` on current version of Go for `lint` and `tests-integration` jobs. | ||
2. Update build tags by replacing `build go1.xx` on new version. | ||
|
||
|
||
### Resolve problems with old version of dependencies | ||
|
||
To build `go.mod` compatible for old version use `go mod tidy -compat=1.13` ([docs](https://go.dev/ref/mod#go-mod-tidy)). | ||
|
||
However, `--compat` doesn't always work correct and we need to set some library versions manually. | ||
|
||
1. `go get go.uber.org/[email protected]` in [trm](trm), [sql](drivers/sql), [sqlx](drivers/sqlx). | ||
2. `go get github.com/mattn/[email protected]` in [trm](trm), [sql](drivers/sql), [sqlx](drivers/sqlx). | ||
3. `go get github.com/stretchr/[email protected]` in [trm](trm), [sql](drivers/sql), [sqlx](drivers/sqlx), [goredis8](drivers/goredis8), [mongo](drivers/mongo). | ||
4. `go get github.com/jackc/[email protected]` in [pgxv4](drivers/pgxv4). Golang version was bumped up from 1.12 to 1.17 in pgconn v1.14.3. | ||
5. `go get golang.org/x/[email protected]` in [pgxv4](drivers/pgxv4). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.