go
No long description provided.
Installation
dagger install github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc
Entrypoint
Return Type
Go !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | Project source directory |
version | String | "1.22.4" | Go version |
lintVersion | String | "1.59" | Go linter version |
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH
func (m *myModule) example(source *Directory) *Go {
return dag.
Go(source)
}
@function
def example(source: dagger.Directory, ) -> dag.Go:
return (
dag.go(source)
)
@func()
example(source: Directory, ): Go {
return dag
.go(source)
}
Types
Go 🔗
A Go project
version() 🔗
Go version
Return Type
String !
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH version
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Go(source).
Version(ctx)
}
@function
async def example(source: dagger.Directory, ) -> str:
return await (
dag.go(source)
.version()
)
@func()
async example(source: Directory, ): Promise<string> {
return dag
.go(source)
.version()
}
lintVersion() 🔗
Go linter version
Return Type
String !
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH lint-version
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Go(source).
LintVersion(ctx)
}
@function
async def example(source: dagger.Directory, ) -> str:
return await (
dag.go(source)
.lint_version()
)
@func()
async example(source: Directory, ): Promise<string> {
return dag
.go(source)
.lintVersion()
}
source() 🔗
Project source directory
Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH source
func (m *myModule) example(source *Directory) *Directory {
return dag.
Go(source).
Source()
}
@function
def example(source: dagger.Directory, ) -> dagger.Directory:
return (
dag.go(source)
.source()
)
@func()
example(source: Directory, ): Directory {
return dag
.go(source)
.source()
}
base() 🔗
Build a base container with Go installed and configured
Return Type
Container !
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH base
func (m *myModule) example(source *Directory) *Container {
return dag.
Go(source).
Base()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
return (
dag.go(source)
.base()
)
@func()
example(source: Directory, ): Container {
return dag
.go(source)
.base()
}
env() 🔗
Prepare a build environment for the given Go source code - Build a base container with Go tooling installed and configured - Mount the source code - Download dependencies
Return Type
Container !
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH env
func (m *myModule) example(source *Directory) *Container {
return dag.
Go(source).
Env()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
return (
dag.go(source)
.env()
)
@func()
example(source: Directory, ): Container {
return dag
.go(source)
.env()
}
lint() 🔗
Lint the project
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
pkgs | [String ! ] ! | - | No description provided |
all | Boolean | - | No description provided |
Example
dagger -m github.com/dagger/dagger/ci/std/go@b12109ea74cbb8074e9f43cb9d59aa4d1c81c2bc call \
--source DIR_PATH lint --pkgs string1 --pkgs string2
func (m *myModule) example(ctx context.Context, source *Directory, pkgs []string) {
return dag.
Go(source).
Lint(ctx, pkgs)
}
@function
async def example(source: dagger.Directory, pkgs: List[str]) -> None:
return await (
dag.go(source)
.lint(pkgs)
)
@func()
async example(source: Directory, pkgs: string[]): Promise<void> {
return dag
.go(source)
.lint(pkgs)
}