chore(go): update to go 1.14 (#475)

* chore(go): update to go 1.14

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2020-02-27 13:17:20 +08:00 committed by GitHub
parent 52622558bd
commit cde026d9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 26 deletions

View File

@ -9,7 +9,7 @@ platform:
steps: steps:
- name: vet - name: vet
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make vet - make vet
volumes: volumes:
@ -18,7 +18,7 @@ steps:
- name: lint - name: lint
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make lint - make lint
volumes: volumes:
@ -27,7 +27,7 @@ steps:
- name: misspell - name: misspell
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make misspell-check - make misspell-check
volumes: volumes:
@ -36,7 +36,7 @@ steps:
- name: embedmd - name: embedmd
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make embedmd - make embedmd
volumes: volumes:
@ -45,7 +45,7 @@ steps:
- name: test - name: test
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make test - make test
environment: environment:
@ -83,7 +83,7 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush
environment: environment:
@ -95,7 +95,7 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush
environment: environment:
@ -106,7 +106,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- ./release/linux/amd64/gorush --help - ./release/linux/amd64/gorush --help
@ -162,7 +162,7 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/gorush - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/gorush
environment: environment:
@ -174,7 +174,7 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/gorush - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/gorush
environment: environment:
@ -185,7 +185,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- ./release/linux/arm64/gorush --help - ./release/linux/arm64/gorush --help
@ -241,7 +241,7 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/gorush - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/gorush
environment: environment:
@ -253,7 +253,7 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/gorush - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/gorush
environment: environment:
@ -264,7 +264,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- ./release/linux/arm/gorush --help - ./release/linux/arm/gorush --help
@ -320,7 +320,7 @@ platform:
steps: steps:
- name: build-all-binary - name: build-all-binary
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make release - make release
when: when:

View File

@ -208,7 +208,7 @@ func TestSetProxyURL(t *testing.T) {
err := SetProxy("87.236.233.92:8080") err := SetProxy("87.236.233.92:8080")
assert.Error(t, err) assert.Error(t, err)
assert.Equal(t, "parse 87.236.233.92:8080: invalid URI for request", err.Error()) assert.Equal(t, "parse \"87.236.233.92:8080\": invalid URI for request", err.Error())
err = SetProxy("a.html") err = SetProxy("a.html")
assert.Error(t, err) assert.Error(t, err)

View File

@ -9,7 +9,7 @@
steps: [ steps: [
{ {
name: 'vet', name: 'vet',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'make vet', 'make vet',
@ -23,7 +23,7 @@
}, },
{ {
name: 'lint', name: 'lint',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'make lint', 'make lint',
@ -37,7 +37,7 @@
}, },
{ {
name: 'misspell', name: 'misspell',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'make misspell-check', 'make misspell-check',
@ -51,7 +51,7 @@
}, },
{ {
name: 'embedmd', name: 'embedmd',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'make embedmd', 'make embedmd',
@ -65,7 +65,7 @@
}, },
{ {
name: 'test', name: 'test',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
environment: { environment: {
ANDROID_API_KEY: { 'from_secret': 'android_api_key' }, ANDROID_API_KEY: { 'from_secret': 'android_api_key' },
@ -114,7 +114,7 @@
steps: [ steps: [
{ {
name: 'build-push', name: 'build-push',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
environment: { environment: {
CGO_ENABLED: '0', CGO_ENABLED: '0',
@ -130,7 +130,7 @@
}, },
// { // {
// name: 'build-push-lambda', // name: 'build-push-lambda',
// image: 'golang:1.13', // image: 'golang:1.14',
// pull: 'always', // pull: 'always',
// environment: { // environment: {
// CGO_ENABLED: '0', // CGO_ENABLED: '0',
@ -146,7 +146,7 @@
// }, // },
{ {
name: 'build-tag', name: 'build-tag',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
environment: { environment: {
CGO_ENABLED: '0', CGO_ENABLED: '0',
@ -160,7 +160,7 @@
}, },
{ {
name: 'executable', name: 'executable',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'./release/' + os + '/' + arch + '/' + name + ' --help', './release/' + os + '/' + arch + '/' + name + ' --help',
@ -225,7 +225,7 @@
steps: [ steps: [
{ {
name: 'build-all-binary', name: 'build-all-binary',
image: 'golang:1.13', image: 'golang:1.14',
pull: 'always', pull: 'always',
commands: [ commands: [
'make release' 'make release'