Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base ¶
func Base(client lib.Client, opts ...BaseOption) *dagger.Container
Base returns a basic Go container with the current project mounted to /src. Base also configures some common Go options, like mounting cache directories. It can be used as a base container for more specific Go actions (test, lint, etc).
Types ¶
type BaseOption ¶
type BaseOption interface {
// contains filtered or unexported methods
}
BaseOption configures base parameters.
type LintOption ¶
type LintOption interface {
// contains filtered or unexported methods
}
LintOption configures lint parameters.
func LinterVersion ¶
func LinterVersion(v string) LintOption
LinterVersion is an alias to SourceImageTag to provide a more user-friendly alternative.
func SourceImage ¶
func SourceImage(v string) LintOption
SourceImage specifies which image to use as a source for GolangCI Lint. The value should follow the OCI content addressable format.
func SourceImageRepository ¶
func SourceImageRepository(v string) LintOption
SourceImageRepository specifies which image repository to use as a source for GolangCI Lint. The value should follow the OCI content addressable format (without a tag or digest).
SourceImageRepository is ignored when a full image reference is provided using SourceImage.
func SourceImageTag ¶
func SourceImageTag(v string) LintOption
SourceImageTag specifies which tag from an image repository to use as a source for GolangCI Lint.
SourceImageTag is ignored when a full image reference is provided using SourceImage.
type Option ¶
type Option interface { BaseOption TestOption LintOption }
Option configures common parameters.
func BaseImage ¶
BaseImage specifies which image to use as a base image for Go operations. The value should follow the OCI content addressable format.
func BaseImageRepository ¶
BaseImageRepository specifies which image repository to use as a base image for Go operations. The value should follow the OCI content addressable format (without a tag or digest).
BaseImageRepository is ignored when a full image reference is provided using BaseImage.
func BaseImageTag ¶
BaseImageTag specifies which tag from an image repository to use as a base image for Go operations.
BaseImageTag is ignored when a full image reference is provided using BaseImage.
func DisableCgo ¶
func DisableCgo() Option
DisableCgo sets CGO_ENABLED to 0.
If not set, Go will fall back to the default value.
func EnableCgo ¶
func EnableCgo() Option
EnableCgo sets CGO_ENABLED to 1.
If not set, Go will fall back to the default value.
func ProjectRoot ¶
ProjectRoot sets the project root to an alternate path (relative or absolute).
func Version ¶
Version is an alias to BaseImageTag to provide a more user-friendly alternative.
type TestOption ¶
type TestOption interface {
// contains filtered or unexported methods
}
TestOption configures test parameters.
func CoverProfile ¶
func CoverProfile(v string) TestOption
CoverProfile specifies the output file for coverage information.
func EnableRaceDetector ¶
func EnableRaceDetector() TestOption
EnableRaceDetector enables the race detector.