From e57a024960459a43ae2fa73cce7861a124e13463 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Thu, 18 Feb 2021 21:33:36 -0800 Subject: [PATCH] Support Go 1.16 and drop support for Go 1.15 - Document CLI install instructions for Go 1.16 - Update golangci-lint from v1.33.0 to v1.37.0 --- .circleci/config.yml | 12 ++++++------ README.md | 2 +- cmd/migrate/README.md | 9 +++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad0d1984c..d36ed9f22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2.1 jobs: - "golang-1_14": &template + "golang-1_15": &template machine: # https://circleci.com/docs/2.0/configuration-reference/#available-machine-images image: ubuntu-2004:202010-01 @@ -19,7 +19,7 @@ jobs: environment: GO111MODULE: "on" - GO_VERSION: "1.14.x" + GO_VERSION: "1.15.x" steps: # - setup_remote_docker: @@ -29,7 +29,7 @@ jobs: - run: curl -sfL -o ~/bin/golangci-lint.sh https://install.goreleaser.com/github.com/golangci/golangci-lint.sh - run: chmod +x ~/bin/gimme ~/bin/golangci-lint.sh - run: eval "$(gimme $GO_VERSION)" - - run: golangci-lint.sh -b ~/bin v1.33.0 + - run: golangci-lint.sh -b ~/bin v1.37.0 - checkout - restore_cache: keys: @@ -43,14 +43,14 @@ jobs: - run: go get github.com/mattn/goveralls - run: goveralls -service=circle-ci -coverprofile /tmp/coverage/combined.txt - "golang-1_15": + "golang-1_16": <<: *template environment: - GO_VERSION: "1.15.x" + GO_VERSION: "1.16.x" workflows: version: 2 build: jobs: - - "golang-1_14" - "golang-1_15" + - "golang-1_16" diff --git a/README.md b/README.md index ca6ca86a6..512423c00 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Coverage Status](https://img.shields.io/coveralls/github/golang-migrate/migrate/master.svg)](https://coveralls.io/github/golang-migrate/migrate?branch=master) [![packagecloud.io](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/golang-migrate/migrate?filter=debs) [![Docker Pulls](https://img.shields.io/docker/pulls/migrate/migrate.svg)](https://hub.docker.com/r/migrate/migrate/) -![Supported Go Versions](https://img.shields.io/badge/Go-1.14%2C%201.15-lightgrey.svg) +![Supported Go Versions](https://img.shields.io/badge/Go-1.15%2C%201.16-lightgrey.svg) [![GitHub Release](https://img.shields.io/github/release/golang-migrate/migrate.svg)](https://github.com/golang-migrate/migrate/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-migrate/migrate)](https://goreportcard.com/report/github.com/golang-migrate/migrate) diff --git a/cmd/migrate/README.md b/cmd/migrate/README.md index b32384d96..3758a66d6 100644 --- a/cmd/migrate/README.md +++ b/cmd/migrate/README.md @@ -41,17 +41,21 @@ $ apt-get install -y migrate $ go get -u -d github.com/golang-migrate/migrate/cmd/migrate $ cd $GOPATH/src/github.com/golang-migrate/migrate/cmd/migrate $ git checkout $TAG # e.g. v4.1.0 +$ # Go 1.15 and below $ go build -tags 'postgres' -ldflags="-X main.Version=$(git describe --tags)" -o $GOPATH/bin/migrate $GOPATH/src/github.com/golang-migrate/migrate/cmd/migrate +$ # Go 1.16+ +$ go install -tags 'postgres' -o $GOPATH/bin/migrate github.com/golang-migrate/migrate/v4/cmd/migrate@$TAG ``` #### Unversioned ```bash +$ # Go 1.15 and below $ go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate +$ # Go 1.16+ +$ go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest ``` -[Make sure](https://github.com/golang-migrate/migrate/pull/257#issuecomment-705249902) you're not installing the `migrate` CLI from a module. e.g. there should not be any `go.mod` files in your current directory or any directory from your current one to the root - #### Notes 1. Requires a version of Go that [supports modules](https://golang.org/cmd/go/#hdr-Preliminary_module_support). e.g. Go 1.11+ @@ -62,6 +66,7 @@ correspond to the names of the sub-packages underneath the [`database`](../database) package. 1. Similarly to the database build tags, if you need to support other sources, use the appropriate build tag(s). 1. Support for build constraints will be removed in the future: https://github.com/golang-migrate/migrate/issues/60 +1. For versions of Go 1.15 and lower, [make sure](https://github.com/golang-migrate/migrate/pull/257#issuecomment-705249902) you're not installing the `migrate` CLI from a module. e.g. there should not be any `go.mod` files in your current directory or any directory from your current directory to the root ## Usage