Skip to content

Commit

Permalink
Upgrade to Go 1.16 (#65)
Browse files Browse the repository at this point in the history
This change upgrades the Go toolchain to 1.16.x.

A relevant change is the support for newlines in template actions. Chained
actions, eg '"some value" | printf "%s-suffix"' can now span multiple lines
inside the {{}} action delimiters.
  • Loading branch information
Crevil committed Mar 23, 2021
1 parent 89c04a2 commit 600e042
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- "1.15.x"
- "1.16.x"

script: |
echo "Build shuttle" &&
Expand Down
7 changes: 6 additions & 1 deletion examples/custom-template.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Custom docker file template not located inside a project
FROM golang:{{ get "GO_VERSION" .Args }}-alpine as builder
{{-
$imageTag :=
get "GO_VERSION" .Args |
printf "%s-alpine"
}}
FROM golang:{{ $imageTag }} as builder

LABEL custom=field

Expand Down
2 changes: 1 addition & 1 deletion tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ test_run_shell_error_outputs_unknown_argument() {
}

test_template_local_path() {
assertErrorCode 0 -p examples/moon-base template ../custom-template.tmpl -o Dockerfile-custom
assertErrorCode 0 -p examples/moon-base template ../custom-template.tmpl -o Dockerfile-custom GO_VERSION=1.16
}

test_template_local_path_alternate_delims() {
Expand Down

0 comments on commit 600e042

Please sign in to comment.