Dagger
Search

go

No long description provided.

Installation

dagger install github.com/dagger/go@a756188f44740e24951e06e68e884434f88ee6ce

Entrypoint

Return Type
Module !
Arguments
NameTypeDefault ValueDescription
pathString !-Path of the module directory in the workspace.
versionString !-Go version to use.
sourceDirectory !-Filtered workspace source mounted for Go commands.
testdataDirectory !-Filtered test fixture files mounted only while running tests.
Example
Function Module.Constructor is not accessible from the go module
Function Module.Constructor is not accessible from the go module
Function Module.Constructor is not accessible from the go module
Function Module.Constructor is not accessible from the go module

Entrypoint

Return Type
Go !
Arguments
NameTypeDefault ValueDescription
versionString -Go version to use.
includeExtra[String ! ] -Extra workspace paths to include when running Go commands. Use this for project-specific fixtures or generated assets needed by tests.
excludeExtra[String ! ] -Extra workspace paths to exclude when discovering modules and running Go commands. Use this to narrow checks to a subset of the workspace.
Example
dagger -m github.com/dagger/go@a756188f44740e24951e06e68e884434f88ee6ce call \
func (m *MyModule) Example() *dagger.Go  {
	return dag.
			Go()
}
@function
def example() -> dagger.Go:
	return (
		dag.go()
	)
@func()
example(): Go {
	return dag
		.go()
}

Types

Module 🔗

A discovered Go module in the workspace.

path() 🔗

Path of the module directory in the workspace.

Return Type
String !
Example
Function GoModule.path is not accessible from the go module
Function GoModule.path is not accessible from the go module
Function GoModule.path is not accessible from the go module
Function GoModule.path is not accessible from the go module

test() 🔗

Run tests in this module.

Return Type
Void !
Example
Function GoModule.test is not accessible from the go module
Function GoModule.test is not accessible from the go module
Function GoModule.test is not accessible from the go module
Function GoModule.test is not accessible from the go module

Go 🔗

A Dagger module for Go - a programming language for building simple, secure, scalable systems. https://dagger.io https://golang.org

version() 🔗

Go version to use.

Return Type
String !
Example
dagger -m github.com/dagger/go@a756188f44740e24951e06e68e884434f88ee6ce call \
 version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Go().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.go()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.go()
		.version()
}

includeExtra() 🔗

Extra workspace paths to include when running Go commands. Use this for project-specific fixtures or generated assets needed by tests.

Return Type
[String ! ] !
Example
dagger -m github.com/dagger/go@a756188f44740e24951e06e68e884434f88ee6ce call \
 include-extra
func (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Go().
			IncludeExtra(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.go()
		.include_extra()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.go()
		.includeExtra()
}

excludeExtra() 🔗

Extra workspace paths to exclude when discovering modules and running Go commands. Use this to narrow checks to a subset of the workspace.

Return Type
[String ! ] !
Example
dagger -m github.com/dagger/go@a756188f44740e24951e06e68e884434f88ee6ce call \
 exclude-extra
func (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Go().
			ExcludeExtra(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.go()
		.exclude_extra()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.go()
		.excludeExtra()
}

modules() 🔗

Scan the workspace for Go modules.

Return Type
[Module ! ] !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() []*dagger.GoModule  {
	return dag.
			Go().
			Modules()
}
@function
def example() -> List[dagger.GoModule]:
	return (
		dag.go()
		.modules()
	)
@func()
example(): GoModule[] {
	return dag
		.go()
		.modules()
}

check() 🔗

Run tests in every discovered Go module.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Go().
			Check(ctx)
}
@function
async def example() -> None:
	return await (
		dag.go()
		.check()
	)
@func()
async example(): Promise<void> {
	return dag
		.go()
		.check()
}