Skip to main content

alpha.dagger.io/go

Go build operations

import "alpha.dagger.io/go"

go.#Build

Go application builder

go.#Build Inputs

NameTypeDescription
version*"1.16" \| stringGo version to use
sourcedagger.#ArtifactSource Directory to build
packages*"." \| stringPackages to build
arch*"amd64" \| stringTarget architecture
os*"linux" \| stringTarget OS
tags*"" \| stringBuild tags to use for building
ldflags*"" \| stringLDFLAGS to use for linking

go.#Build Outputs

NameTypeDescription
outputstringSpecify the targeted binary name

go.#Container

A standalone go environment

go.#Container Inputs

NameTypeDescription
version*"1.16" \| stringGo version to use
sourcedagger.#ArtifactSource code
image.from"docker.io/golang:1.16-alpine"Remote ref (example: "index.docker.io/alpine:latest")

go.#Container Outputs

No output.

go.#Go

Re-usable component for the Go compiler

go.#Go Inputs

NameTypeDescription
version*"1.16" \| stringGo version to use
args[...string]Arguments to the Go binary
sourcedagger.#ArtifactSource Directory to build

go.#Go Outputs

No output.

go.#Test

go.#Test Inputs

NameTypeDescription
version*"1.16" \| stringGo version to use
sourcedagger.#ArtifactSource Directory to build
packages*"." \| stringPackages to test
args["test", "-v", *"." \| string]Arguments to the Go binary

go.#Test Outputs

No output.