Dagger
Search

golang

This module has been generated via dagger init and serves as a reference to basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them, as needed. They demonstrate usage of arguments and return types using simple echo and grep commands. The functions can be called from the dagger CLI or from one of the SDKs.

The first line in this comment block is a short description line and the rest is a long description with more detail on the module's purpose or usage, if appropriate. All modules should have a short description.

Installation

dagger install github.com/mycroft/go-dagger-ci/golang@f039c63ee3ed83d52254673a83f508398bc422ea

Entrypoint

Return Type
Golang
Example
func (m *myModule) example() *Golang  {
	return dag.
			Golang()
}
@function
def example() -> dag.Golang:
	return (
		dag.golang()
	)
@func()
example(): Golang {
	return dag
		.golang()
}

Types

Golang 🔗

getContainer() 🔗

Returns a container for testing & build

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
golangVersionString !-No description provided
sourceDirectory !-No description provided
Example
func (m *myModule) example(golangVersion string, source *Directory) *Container  {
	return dag.
			Golang().
			GetContainer(golangVersion, source)
}
@function
def example(golang_version: str, source: dagger.Directory) -> dagger.Container:
	return (
		dag.golang()
		.get_container(golang_version, source)
	)
@func()
example(golangVersion: string, source: Directory): Container {
	return dag
		.golang()
		.getContainer(golangVersion, source)
}

build() 🔗

Returning a container after running build

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
golangVersionString !-No description provided
sourceDirectory !-No description provided
Example
func (m *myModule) example(golangVersion string, source *Directory) *Container  {
	return dag.
			Golang().
			Build(golangVersion, source)
}
@function
def example(golang_version: str, source: dagger.Directory) -> dagger.Container:
	return (
		dag.golang()
		.build(golang_version, source)
	)
@func()
example(golangVersion: string, source: Directory): Container {
	return dag
		.golang()
		.build(golangVersion, source)
}

test() 🔗

Returning a container after running build and test

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
golangVersionString !-No description provided
sourceDirectory !-No description provided
Example
func (m *myModule) example(golangVersion string, source *Directory) *Container  {
	return dag.
			Golang().
			Test(golangVersion, source)
}
@function
def example(golang_version: str, source: dagger.Directory) -> dagger.Container:
	return (
		dag.golang()
		.test(golang_version, source)
	)
@func()
example(golangVersion: string, source: Directory): Container {
	return dag
		.golang()
		.test(golangVersion, source)
}