golang
No long description provided.
Installation
dagger install github.com/vbehar/mason-modules/golang@v0.0.2Entrypoint
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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a 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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
sourcefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
modulefunc (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()
}baseBuildContainer() 🔗
Return Type
Container ! Example
dagger -m github.com/vbehar/mason-modules/golang@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
base-build-containerfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
base-run-containerfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
containerfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
build-binaryfunc (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()
}renderPlan() 🔗
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| blueprint | Directory ! | - | No description provided |
Example
dagger -m github.com/vbehar/mason-modules/golang@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
render-plan --blueprint DIR_PATHfunc (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)
}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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lintfunc (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()
}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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
testfunc (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()
}LintRun 🔗
ctr() 🔗
Return Type
Container ! Example
dagger -m github.com/vbehar/mason-modules/golang@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lint \
ctrfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lint \
exit-codefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lint \
assertfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lint \
code-climate-filefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
lint \
reportsfunc (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()
}TestRun 🔗
ctr() 🔗
Return Type
Container ! Example
dagger -m github.com/vbehar/mason-modules/golang@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
ctrfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
exit-codefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
assertfunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
junit-filefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
json-filefunc (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@1e7f64af3db73981a4e1c70d72437c46d12b8a3a call \
test \
reportsfunc (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()
}