go
No long description provided.
Installation
dagger install github.com/dagger/go@c37667c9a265c2abf7bdd93694b1c285e2fcac6eEntrypoint
Return Type
Go !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Go version to use. |
| includeExtraFiles | [String ! ] | - | Extra workspace files to include when running Go commands. Use this for project-specific fixtures, generator inputs, or other files not covered by the built-in Go patterns. |
| selectModules | [String ! ] | - | Go module path globs to include when discovering modules. When unset, every discovered module is included. |
| selectModule | String | - | Single Go module path glob to include when legacy callers cannot pass arrays. Ignored when selectModules is set. |
Example
dagger -m github.com/dagger/go@c37667c9a265c2abf7bdd93694b1c285e2fcac6e call \
func (m *MyModule) Example() *dagger.Go {
return dag.
Go()
}@function
def example() -> dagger.Go:
return (
dag.go()
)@func()
example(): Go {
return dag
.go()
}Entrypoint
Return Type
Module !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | Path of the module directory in the workspace. |
| version | String ! | - | Go version to use. |
| source | Directory ! | - | Filtered workspace source mounted for Go commands. |
| testdata | Directory ! | - | Filtered test fixture files mounted only while running tests. |
| workdir | String ! | - | Module directory path relative to the mounted workspace boundary. |
Example
Function Module.Constructor is not accessible from the go moduleFunction Module.Constructor is not accessible from the go moduleFunction Module.Constructor is not accessible from the go moduleFunction Module.Constructor is not accessible from the go moduleTypes
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@c37667c9a265c2abf7bdd93694b1c285e2fcac6e call \
versionfunc (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()
}includeExtraFiles() 🔗
Extra workspace files to include when running Go commands. Use this for project-specific fixtures, generator inputs, or other files not covered by the built-in Go patterns.
Return Type
[String ! ] ! Example
dagger -m github.com/dagger/go@c37667c9a265c2abf7bdd93694b1c285e2fcac6e call \
include-extra-filesfunc (m *MyModule) Example(ctx context.Context) []string {
return dag.
Go().
IncludeExtraFiles(ctx)
}@function
async def example() -> List[str]:
return await (
dag.go()
.include_extra_files()
)@func()
async example(): Promise<string[]> {
return dag
.go()
.includeExtraFiles()
}selectModules() 🔗
Go module path globs to include when discovering modules. When unset, every discovered module is included.
Return Type
[String ! ] Example
dagger -m github.com/dagger/go@c37667c9a265c2abf7bdd93694b1c285e2fcac6e call \
select-modulesfunc (m *MyModule) Example(ctx context.Context) []string {
return dag.
Go().
SelectModules(ctx)
}@function
async def example() -> List[str]:
return await (
dag.go()
.select_modules()
)@func()
async example(): Promise<string[]> {
return dag
.go()
.selectModules()
}selectModule() 🔗
Single Go module path glob to include when legacy callers cannot pass arrays. Ignored when selectModules is set.
Return Type
String Example
dagger -m github.com/dagger/go@c37667c9a265c2abf7bdd93694b1c285e2fcac6e call \
select-modulefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Go().
SelectModule(ctx)
}@function
async def example() -> str:
return await (
dag.go()
.select_module()
)@func()
async example(): Promise<string> {
return dag
.go()
.selectModule()
}modules() 🔗
Scan the workspace for Go modules.
Return Type
[Module ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | 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()
}testAll() 🔗
Run tests in every discovered Go module.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context) {
return dag.
Go().
TestAll(ctx)
}@function
async def example() -> None:
return await (
dag.go()
.test_all()
)@func()
async example(): Promise<void> {
return dag
.go()
.testAll()
}generate() 🔗
Run go generate in every discovered Go module.
Return Type
Changeset !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ws | Workspace | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example() *dagger.Changeset {
return dag.
Go().
Generate()
}@function
def example() -> dagger.Changeset:
return (
dag.go()
.generate()
)@func()
example(): Changeset {
return dag
.go()
.generate()
}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 moduleFunction GoModule.path is not accessible from the go moduleFunction GoModule.path is not accessible from the go moduleFunction GoModule.path is not accessible from the go modulegenerate() 🔗
Module directory after running go generate.
Return Type
Directory ! Example
Function GoModule.generate is not accessible from the go moduleFunction GoModule.generate is not accessible from the go moduleFunction GoModule.generate is not accessible from the go moduleFunction GoModule.generate is not accessible from the go modulebase() 🔗
Base container for Go commands.
Return Type
Container ! Example
Function GoModule.base is not accessible from the go moduleFunction GoModule.base is not accessible from the go moduleFunction GoModule.base is not accessible from the go moduleFunction GoModule.base is not accessible from the go moduletest() 🔗
Run tests in this module.
Return Type
Void ! Example
Function GoModule.test is not accessible from the go moduleFunction GoModule.test is not accessible from the go moduleFunction GoModule.test is not accessible from the go moduleFunction GoModule.test is not accessible from the go module