Skip to content

go

A set of Go tasks.

List of tasks

Tasks Description
go:format-check Check code with gofmt and go vet. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)
go:mod-download Go mod download. Arguments: [IMG|I=golang:latest] PULL|P=
go:mod-outdated Check outdated Go modules. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)
go:mod-tidy Go mod tidy. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)
go:test-unit Run Go unit tests. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)
go:test-unit-verbose Run Go unit tests with details. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)
go:vulncheck Find and fix vulnerable dependencies with vulncheck. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

global variables

Variables Description Default value
DOCKER_RUN_OPTS Optional Docker options for docker run command -
IMAGE_GO Default Docker image for Go golang:latest

go:format-check

Check code with gofmt and go vet. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Check code with gofmt and go vet.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:format-check [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:mod-download

Go mod download. Arguments: [IMG|I=golang:latest] PULL|P=

[GO] Go mod download.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:mod-clean [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:mod-outdated

Check outdated Go modules. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Check outdated Go modules.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:mod-outdated [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:mod-tidy

Go mod tidy. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Go mod tidy.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:mod-clean [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:test-unit

Run Go unit tests. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Run Go unit tests.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:test-unit [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:test-unit-verbose

Run Go unit tests with details. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Run Go unit tests with details.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:test-unit-verbose [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None

go:vulncheck

Find and fix vulnerable dependencies with vulncheck. Arguments: [IMG|I=golang:latest] [PULL|P=] (*)

[GO] Find and fix vulnerable dependencies with vulncheck.
If Go command is in the path and IMG/I argument is not set, the local Go command is executed,
otherwise a Go Docker image is used.
Usage: task go:vulncheck [IMG|I=<Docker_image:tag>] [PULL|P=<n|N>]
Arguments Description
IMG | I Docker Go image to use (optional, by default {{.IMAGE_GO}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • None