mirror of
https://github.com/thegeeklab/drone-template-lib.git
synced 2024-11-21 20:20:39 +00:00
chore: switch to go1.19 (#16)
This commit is contained in:
parent
142a69d16b
commit
f39f868bc8
@ -8,7 +8,7 @@ local PipelineTest(deps=[],) = {
|
|||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
name: 'deps',
|
name: 'deps',
|
||||||
image: 'golang:1.18',
|
image: 'golang:1.19',
|
||||||
commands: [
|
commands: [
|
||||||
'make deps',
|
'make deps',
|
||||||
],
|
],
|
||||||
@ -21,7 +21,7 @@ local PipelineTest(deps=[],) = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'lint',
|
name: 'lint',
|
||||||
image: 'golang:1.18',
|
image: 'golang:1.19',
|
||||||
commands: [
|
commands: [
|
||||||
'make lint',
|
'make lint',
|
||||||
],
|
],
|
||||||
@ -34,7 +34,7 @@ local PipelineTest(deps=[],) = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'test',
|
name: 'test',
|
||||||
image: 'golang:1.18',
|
image: 'golang:1.19',
|
||||||
commands: [
|
commands: [
|
||||||
'make test',
|
'make test',
|
||||||
],
|
],
|
||||||
|
@ -8,7 +8,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: deps
|
- name: deps
|
||||||
image: golang:1.18
|
image: golang:1.19
|
||||||
commands:
|
commands:
|
||||||
- make deps
|
- make deps
|
||||||
volumes:
|
volumes:
|
||||||
@ -16,7 +16,7 @@ steps:
|
|||||||
path: /go
|
path: /go
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
image: golang:1.18
|
image: golang:1.19
|
||||||
commands:
|
commands:
|
||||||
- make lint
|
- make lint
|
||||||
volumes:
|
volumes:
|
||||||
@ -24,7 +24,7 @@ steps:
|
|||||||
path: /go
|
path: /go
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: golang:1.18
|
image: golang:1.19
|
||||||
commands:
|
commands:
|
||||||
- make test
|
- make test
|
||||||
volumes:
|
volumes:
|
||||||
@ -156,6 +156,6 @@ depends_on:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 4f3ed20143c606dfd970a528dfe74ed13e3899de1221b3b68635041bcedff385
|
hmac: 84521962c13647c129172e114ade6a46c8d4564be36f654fce48b56583f27d65
|
||||||
|
|
||||||
...
|
...
|
||||||
|
2
Makefile
2
Makefile
@ -19,7 +19,7 @@ GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@$(G
|
|||||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||||
|
|
||||||
GENERATE ?=
|
GENERATE ?=
|
||||||
XGO_VERSION := go-1.18.x
|
XGO_VERSION := go-1.19.x
|
||||||
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
|
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
|
||||||
|
|
||||||
TAGS ?= netgo
|
TAGS ?= netgo
|
||||||
|
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
|||||||
module github.com/thegeeklab/drone-template-lib/v2
|
module github.com/thegeeklab/drone-template-lib/v2
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/sprig/v3 v3.2.2
|
github.com/Masterminds/sprig/v3 v3.2.2
|
||||||
|
@ -8,9 +8,10 @@ package template
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/flowchartsman/handlebars/v3"
|
"github.com/flowchartsman/handlebars/v3"
|
||||||
@ -33,14 +34,14 @@ func Render(template string, payload interface{}) (s string, err error) {
|
|||||||
|
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
out, err := ioutil.ReadAll(res.Body)
|
out, err := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, fmt.Errorf("failed to read: %w", err)
|
return s, fmt.Errorf("failed to read: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
template = string(out)
|
template = string(out)
|
||||||
case "file":
|
case "file":
|
||||||
out, err := ioutil.ReadFile(u.Path)
|
out, err := os.ReadFile(u.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, fmt.Errorf("failed to read: %w", err)
|
return s, fmt.Errorf("failed to read: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user