Dagger
Search

golang

No long description provided.

Installation

dagger install github.com/kpenfound/dagger-modules/golang@v0.1.4

Entrypoint

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
ctrContainer -No description provided
projDirectory -No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
func (m *myModule) example() *Golang  {
	return dag.
			Golang()
}
@function
def example() -> dag.Golang:
	return (
		dag.golang()
	)
@func()
example(): Golang {
	return dag
		.golang()
}

Types

Golang 🔗

ctr() 🔗

Return Type
Container !
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 ctr
func (m *myModule) example() *Container  {
	return dag.
			Golang().
			Ctr()
}
@function
def example() -> dagger.Container:
	return (
		dag.golang()
		.ctr()
	)
@func()
example(): Container {
	return dag
		.golang()
		.ctr()
}

proj() 🔗

Return Type
Directory !
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 proj
func (m *myModule) example() *Directory  {
	return dag.
			Golang().
			Proj()
}
@function
def example() -> dagger.Directory:
	return (
		dag.golang()
		.proj()
	)
@func()
example(): Directory {
	return dag
		.golang()
		.proj()
}

build() 🔗

Build the Go project

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-No description provided
archString -No description provided
osString -No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 build --args string1 --args string2
func (m *myModule) example(args []string) *Directory  {
	return dag.
			Golang().
			Build(args)
}
@function
def example(args: List[str]) -> dagger.Directory:
	return (
		dag.golang()
		.build(args)
	)
@func()
example(args: string[]): Directory {
	return dag
		.golang()
		.build(args)
}

test() 🔗

Test the Go project

Return Type
String !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 test --args string1 --args string2
func (m *myModule) example(ctx context.Context, args []string) string  {
	return dag.
			Golang().
			Test(ctx, args)
}
@function
async def example(args: List[str]) -> str:
	return await (
		dag.golang()
		.test(args)
	)
@func()
async example(args: string[]): Promise<string> {
	return dag
		.golang()
		.test(args)
}

golangciLint() 🔗

Lint the Go project

Return Type
String !
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 golangci-lint
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Golang().
			GolangciLint(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.golangci_lint()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.golangciLint()
}

base() 🔗

Sets up the Container with a golang image and cache volumes

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
versionString !-No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 base --version string
func (m *myModule) example(version string) *Golang  {
	return dag.
			Golang().
			Base(version)
}
@function
def example(version: str) -> dag.Golang:
	return (
		dag.golang()
		.base(version)
	)
@func()
example(version: string): Golang {
	return dag
		.golang()
		.base(version)
}

container() 🔗

Accessor for the Container

Return Type
Container !
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 container
func (m *myModule) example() *Container  {
	return dag.
			Golang().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.golang()
		.container()
	)
@func()
example(): Container {
	return dag
		.golang()
		.container()
}

project() 🔗

Accessor for the Project

Return Type
Directory !
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 project
func (m *myModule) example() *Directory  {
	return dag.
			Golang().
			Project()
}
@function
def example() -> dagger.Directory:
	return (
		dag.golang()
		.project()
	)
@func()
example(): Directory {
	return dag
		.golang()
		.project()
}

withProject() 🔗

Specify the Project to use in the module

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 with-project --dir DIR_PATH
func (m *myModule) example(dir *Directory) *Golang  {
	return dag.
			Golang().
			WithProject(dir)
}
@function
def example(dir: dagger.Directory) -> dag.Golang:
	return (
		dag.golang()
		.with_project(dir)
	)
@func()
example(dir: Directory): Golang {
	return dag
		.golang()
		.withProject(dir)
}

withContainer() 🔗

Bring your own container

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 with-container --ctr IMAGE:TAG
func (m *myModule) example(ctr *Container) *Golang  {
	return dag.
			Golang().
			WithContainer(ctr)
}
@function
def example(ctr: dagger.Container) -> dag.Golang:
	return (
		dag.golang()
		.with_container(ctr)
	)
@func()
example(ctr: Container): Golang {
	return dag
		.golang()
		.withContainer(ctr)
}

buildRemote() 🔗

Build a remote git repo

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
remoteString !-No description provided
refString !-No description provided
moduleString !-No description provided
archString -No description provided
platformString -No description provided
Example
dagger -m github.com/kpenfound/dagger-modules/golang@5cb802660efb1242e5d7beb382f772f0a3f34616 call \
 build-remote --remote string --ref string --module string
func (m *myModule) example(remote string, ref string, module string) *Directory  {
	return dag.
			Golang().
			BuildRemote(remote, ref, module)
}
@function
def example(remote: str, ref: str, module: str) -> dagger.Directory:
	return (
		dag.golang()
		.build_remote(remote, ref, module)
	)
@func()
example(remote: string, ref: string, module: string): Directory {
	return dag
		.golang()
		.buildRemote(remote, ref, module)
}