I'm new to go and am trying to figure out how to execute the build step in my circleci project.
I noticed in the CircleCI Go orb, that there was no use of go build
, which was confusing to me because in the CircleCI Go Language Guide, they specifically use go build
via a makefile.
So I am not sure if using the Go orb alone is sufficient (though that seems odd to me). I vaguely understand what go mod download does, and what go build does, but I've seen examples where they are used together:
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
Currently, according to the go orb usage doc, I have:
build:
executor: go
steps:
- checkout
- go/load-cache:
key: go-mod-v1-{{ checksum "go.sum" }}
- go/mod-download
- go/save-cache:
key: go-mod-v1-{{ checksum "go.sum" }}
- slack/notify:
event: fail
template: basic_fail_1
What am I missing or unintentionally including by using go mod download
instead of go build
or go build
with go mod download
?