golang
No long description provided.
Installation
dagger install github.com/vbehar/mason-modules/golang@v0.0.3
Entrypoint
Return Type
Golang !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | the root directory of the source code |
module | String | - | the subdirectory in the source directory where the go module is located in case of multi-modules repository |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
func (m *MyModule) Example() *dagger.Golang {
return dag.
Golang()
}
@function
def example() -> dagger.Golang:
return (
dag.golang()
)
@func()
example(): Golang {
return dag
.golang()
}
Types
Golang 🔗
source() 🔗
Return Type
Directory !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
source
func (m *MyModule) Example() *dagger.Directory {
return dag.
Golang().
Source()
}
@function
def example() -> dagger.Directory:
return (
dag.golang()
.source()
)
@func()
example(): Directory {
return dag
.golang()
.source()
}
module() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
module
func (m *MyModule) Example(ctx context.Context) string {
return dag.
Golang().
Module(ctx)
}
@function
async def example() -> str:
return await (
dag.golang()
.module()
)
@func()
async example(): Promise<string> {
return dag
.golang()
.module()
}
test() 🔗
Return Type
TestRun !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] | - | "go test" extra arguments |
baseContainer | Container | - | No description provided |
gotestsumVersion | String | "1.12.1" | The version of the gotestsum tool to use. See https://github.com/gotestyourself/gotestsum/releases |
tparseVersion | String | "0.17.0" | The version of the tparse tool to use. See https://github.com/mfridman/tparse/releases |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test
func (m *MyModule) Example() *dagger.GolangTestRun {
return dag.
Golang().
Test()
}
@function
def example() -> dagger.GolangTestRun:
return (
dag.golang()
.test()
)
@func()
example(): GolangTestRun {
return dag
.golang()
.test()
}
renderPlan() 🔗
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
blueprint | Directory ! | - | No description provided |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
render-plan --blueprint DIR_PATH
func (m *MyModule) Example(blueprint *dagger.Directory) *dagger.Directory {
return dag.
Golang().
RenderPlan(blueprint)
}
@function
def example(blueprint: dagger.Directory) -> dagger.Directory:
return (
dag.golang()
.render_plan(blueprint)
)
@func()
example(blueprint: Directory): Directory {
return dag
.golang()
.renderPlan(blueprint)
}
baseBuildContainer() 🔗
Return Type
Container !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
base-build-container
func (m *MyModule) Example() *dagger.Container {
return dag.
Golang().
BaseBuildContainer()
}
@function
def example() -> dagger.Container:
return (
dag.golang()
.base_build_container()
)
@func()
example(): Container {
return dag
.golang()
.baseBuildContainer()
}
baseRunContainer() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
platform | Scalar | - | No description provided |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
base-run-container
func (m *MyModule) Example() *dagger.Container {
return dag.
Golang().
BaseRunContainer()
}
@function
def example() -> dagger.Container:
return (
dag.golang()
.base_run_container()
)
@func()
example(): Container {
return dag
.golang()
.baseRunContainer()
}
container() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
baseContainer | Container | - | No description provided |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
container
func (m *MyModule) Example() *dagger.Container {
return dag.
Golang().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.golang()
.container()
)
@func()
example(): Container {
return dag
.golang()
.container()
}
buildBinary() 🔗
Build a binary for a specific platform - defaulting to the current platform
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
goOs | String | - | Go OS target Default to the default platform's OS |
goArch | String | - | Go architecture target Default to the default platform's architecture |
args | [String ! ] | - | "go build" extra arguments |
outputFileName | String | - | Name of the output file Default to "{os}_{arch}" |
baseContainer | Container | - | No description provided |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
build-binary
func (m *MyModule) Example() *dagger.File {
return dag.
Golang().
BuildBinary()
}
@function
def example() -> dagger.File:
return (
dag.golang()
.build_binary()
)
@func()
example(): File {
return dag
.golang()
.buildBinary()
}
lint() 🔗
Return Type
LintRun !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] | - | "golangci-lint run" extra arguments |
baseContainer | Container | - | No description provided |
golangcilintVersion | String | "2.1.5" | The version of the golangci-lint tool to use. See https://github.com/golangci/golangci-lint/releases |
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint
func (m *MyModule) Example() *dagger.GolangLintRun {
return dag.
Golang().
Lint()
}
@function
def example() -> dagger.GolangLintRun:
return (
dag.golang()
.lint()
)
@func()
example(): GolangLintRun {
return dag
.golang()
.lint()
}
TestRun 🔗
ctr() 🔗
Return Type
Container !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
ctr
func (m *MyModule) Example() *dagger.Container {
return dag.
Golang().
Test().
Ctr()
}
@function
def example() -> dagger.Container:
return (
dag.golang()
.test()
.ctr()
)
@func()
example(): Container {
return dag
.golang()
.test()
.ctr()
}
exitCode() 🔗
Return Type
Integer !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
exit-code
func (m *MyModule) Example(ctx context.Context) int {
return dag.
Golang().
Test().
ExitCode(ctx)
}
@function
async def example() -> int:
return await (
dag.golang()
.test()
.exit_code()
)
@func()
async example(): Promise<number> {
return dag
.golang()
.test()
.exitCode()
}
assert() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
assert
func (m *MyModule) Example(ctx context.Context) string {
return dag.
Golang().
Test().
Assert(ctx)
}
@function
async def example() -> str:
return await (
dag.golang()
.test()
.assert_()
)
@func()
async example(): Promise<string> {
return dag
.golang()
.test()
.assert()
}
junitFile() 🔗
Return Type
File !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
junit-file
func (m *MyModule) Example() *dagger.File {
return dag.
Golang().
Test().
JunitFile()
}
@function
def example() -> dagger.File:
return (
dag.golang()
.test()
.junit_file()
)
@func()
example(): File {
return dag
.golang()
.test()
.junitFile()
}
jsonFile() 🔗
Return Type
File !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
json-file
func (m *MyModule) Example() *dagger.File {
return dag.
Golang().
Test().
JsonFile()
}
@function
def example() -> dagger.File:
return (
dag.golang()
.test()
.json_file()
)
@func()
example(): File {
return dag
.golang()
.test()
.jsonFile()
}
reports() 🔗
Return Type
Directory !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
test \
reports
func (m *MyModule) Example() *dagger.Directory {
return dag.
Golang().
Test().
Reports()
}
@function
def example() -> dagger.Directory:
return (
dag.golang()
.test()
.reports()
)
@func()
example(): Directory {
return dag
.golang()
.test()
.reports()
}
LintRun 🔗
ctr() 🔗
Return Type
Container !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint \
ctr
func (m *MyModule) Example() *dagger.Container {
return dag.
Golang().
Lint().
Ctr()
}
@function
def example() -> dagger.Container:
return (
dag.golang()
.lint()
.ctr()
)
@func()
example(): Container {
return dag
.golang()
.lint()
.ctr()
}
exitCode() 🔗
Return Type
Integer !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint \
exit-code
func (m *MyModule) Example(ctx context.Context) int {
return dag.
Golang().
Lint().
ExitCode(ctx)
}
@function
async def example() -> int:
return await (
dag.golang()
.lint()
.exit_code()
)
@func()
async example(): Promise<number> {
return dag
.golang()
.lint()
.exitCode()
}
assert() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint \
assert
func (m *MyModule) Example(ctx context.Context) string {
return dag.
Golang().
Lint().
Assert(ctx)
}
@function
async def example() -> str:
return await (
dag.golang()
.lint()
.assert_()
)
@func()
async example(): Promise<string> {
return dag
.golang()
.lint()
.assert()
}
codeClimateFile() 🔗
Return Type
File !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint \
code-climate-file
func (m *MyModule) Example() *dagger.File {
return dag.
Golang().
Lint().
CodeClimateFile()
}
@function
def example() -> dagger.File:
return (
dag.golang()
.lint()
.code_climate_file()
)
@func()
example(): File {
return dag
.golang()
.lint()
.codeClimateFile()
}
reports() 🔗
Return Type
Directory !
Example
dagger -m github.com/vbehar/mason-modules/golang@a8a66cb6aeea8f186b340d2f5799b31bc5cd6b8e call \
lint \
reports
func (m *MyModule) Example() *dagger.Directory {
return dag.
Golang().
Lint().
Reports()
}
@function
def example() -> dagger.Directory:
return (
dag.golang()
.lint()
.reports()
)
@func()
example(): Directory {
return dag
.golang()
.lint()
.reports()
}