golang

package
v0.0.0-...-28244f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 5 Imported by: 0

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).

func Lint

func Lint(client *dagger.Client, opts ...LintOption) *dagger.Container

func Test

func Test(client lib.Client, opts ...TestOption) *dagger.Container

Types

type BaseOption

type BaseOption interface {
	// contains filtered or unexported methods
}

BaseOption configures base parameters.

type CoverMode

type CoverMode uint32

CoverMode sets the coverage mode for Go test.

const (
	CoverModeUndefined CoverMode = iota
	SetCoverMode
	CountCoverMode
	AtomicCoverMode
)

func (CoverMode) String

func (v CoverMode) String() string

func (CoverMode) Valid

func (v CoverMode) Valid() bool

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

func BaseImage(v string) Option

BaseImage specifies which image to use as a base image for Go operations. The value should follow the OCI content addressable format.

func BaseImageRepository

func BaseImageRepository(v string) Option

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

func BaseImageTag(v string) Option

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

func ProjectRoot(v string) Option

ProjectRoot sets the project root to an alternate path (relative or absolute).

func Version

func Version(v string) Option

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.

func Verbose

func Verbose(v bool) TestOption

Verbose enables verbose logging.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL