Dagger
Search

golang

Package main provides a set of functions to run Go language tests within a containerized environment.

Installation

dagger install github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b

Entrypoint

Return Type
Golang
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b 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 🔗

arangoPassword() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 arango-password
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Arangopassword(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.arangopassword()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.arangoPassword()
}

arangoVersion() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 arango-version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Arangoversion(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.arangoversion()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.arangoVersion()
}

arangoPort() 🔗

Return Type
Integer !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 arango-port
func (m *MyModule) Example(ctx context.Context) int  {
	return dag.
			Golang().
			Arangoport(ctx)
}
@function
async def example() -> int:
	return await (
		dag.golang()
		.arangoport()
	)
@func()
async example(): Promise<number> {
	return dag
		.golang()
		.arangoPort()
}

redisPassword() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 redis-password
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Redispassword(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.redispassword()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.redisPassword()
}

redisVersion() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 redis-version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Redisversion(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.redisversion()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.redisVersion()
}

redisPort() 🔗

Return Type
Integer !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 redis-port
func (m *MyModule) Example(ctx context.Context) int  {
	return dag.
			Golang().
			Redisport(ctx)
}
@function
async def example() -> int:
	return await (
		dag.golang()
		.redisport()
	)
@func()
async example(): Promise<number> {
	return dag
		.golang()
		.redisPort()
}

golangVersion() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 golang-version
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Golangversion(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.golangversion()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.golangVersion()
}

gotestSumFormatter() 🔗

Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 gotest-sum-formatter
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golang().
			Gotestsumformatter(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golang()
		.gotestsumformatter()
	)
@func()
async example(): Promise<string> {
	return dag
		.golang()
		.gotestSumFormatter()
}

withRedisVersion() 🔗

WithRedisVersion sets the version of Redis to use.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
versionString "7.0.12"The version of Redis to use
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-redis-version
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Withredisversion()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.withredisversion()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withRedisVersion()
}

withRedisPort() 🔗

WithRedisPort sets the port to expose Redis on.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
portInteger 6379The port to expose Redis on
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-redis-port
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Withredisport()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.withredisport()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withRedisPort()
}

testsWithRedis() 🔗

TestsWithRedis runs Go tests in a container with Redis.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory to test, Required.
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 tests-with-redis --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Golang().
			Testswithredis(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.golang()
		.testswithredis(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.golang()
		.testsWithRedis(src)
}

testsWithRedisFromGithub() 🔗

TestsWithRedisFromGithub fetches a GitHub repository and runs Go tests with Redis.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-The GitHub repository name (e.g., "username/repo")
gitRefString !-The git reference (branch, tag, or commit) to clone and test
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 tests-with-redis-from-github --repository string --git-ref string
func (m *MyModule) Example(ctx context.Context, repository string, gitRef string) string  {
	return dag.
			Golang().
			Testswithredisfromgithub(ctx, repository, gitRef)
}
@function
async def example(repository: str, gitref: str) -> str:
	return await (
		dag.golang()
		.testswithredisfromgithub(repository, gitref)
	)
@func()
async example(repository: string, gitRef: string): Promise<string> {
	return dag
		.golang()
		.testsWithRedisFromGithub(repository, gitRef)
}

testsWithArangoDb() 🔗

TestsWithArangoDB runs Go tests in a container with an ArangoDB.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory to test, Required.
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 tests-with-arango-db --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Golang().
			Testswitharangodb(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.golang()
		.testswitharangodb(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.golang()
		.testsWithArangoDb(src)
}

testsWithArangoDbfromGithub() 🔗

TestsWithArangoDBFromGithub fetches a GitHub repository and runs Go tests with ArangoDB.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-The GitHub repository name (e.g., "username/repo")
gitRefString !-The git reference (branch, tag, or commit) to clone and test
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 tests-with-arango-dbfrom-github --repository string --git-ref string
func (m *MyModule) Example(ctx context.Context, repository string, gitRef string) string  {
	return dag.
			Golang().
			Testswitharangodbfromgithub(ctx, repository, gitRef)
}
@function
async def example(repository: str, gitref: str) -> str:
	return await (
		dag.golang()
		.testswitharangodbfromgithub(repository, gitref)
	)
@func()
async example(repository: string, gitRef: string): Promise<string> {
	return dag
		.golang()
		.testsWithArangoDbfromGithub(repository, gitRef)
}

withArangoPort() 🔗

WithArangoPort sets the port to expose ArangoDB on.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
portInteger 8529The port to expose ArangoDB on
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-arango-port
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Witharangoport()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.witharangoport()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withArangoPort()
}

withArangoVersion() 🔗

WithArangoVersion sets the version of ArangoDB to use.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
versionString "3.10.9"The version of ArangoDB to use
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-arango-version
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Witharangoversion()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.witharangoversion()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withArangoVersion()
}

withArangoPassword() 🔗

WithArangoPassword sets the root password for the ArangoDB instance.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
passwordString "golam"The root password for the ArangoDB instance
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-arango-password
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Witharangopassword()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.witharangopassword()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withArangoPassword()
}

test() 🔗

Test runs Go tests

Return Type
String !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory to test, Required.
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 test --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Golang().
			Test(ctx, src)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.golang()
		.test(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.golang()
		.test(src)
}

lint() 🔗

Lint runs golangci-lint on the Go source code in a containerized environment. It uses a specified version of golangci-lint to perform static code analysis.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
versionString "v1.55.2-alpine"An optional string specifying the version of golangci-lint to use
srcDirectory !-The source directory to test, Required.
args[String ! ] -An optional slice of strings representing additional arguments to the golangci-lint command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 lint --src DIR_PATH
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory) string  {
	return dag.
			Golang().
			Lint(ctxsrc)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.golang()
		.lint(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.golang()
		.lint(src)
}

withGolangVersion() 🔗

WithGolangVersion sets the version of Golang to use.

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
versionString "1.22.6"The version of Golang to use
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-golang-version
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Withgolangversion()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.withgolangversion()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withGolangVersion()
}

withGotestSumFormatter() 🔗

WithGotestSumFormatter sets the output formatter for gotestsum

Return Type
Golang !
Arguments
NameTypeDefault ValueDescription
formatterString "pkgname"The output formatter to use for gotestsum
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 with-gotest-sum-formatter
func (m *MyModule) Example() *dagger.Golang  {
	return dag.
			Golang().
			Withgotestsumformatter()
}
@function
def example() -> dagger.Golang:
	return (
		dag.golang()
		.withgotestsumformatter()
	)
@func()
example(): Golang {
	return dag
		.golang()
		.withGotestSumFormatter()
}

prepareTestContainer() 🔗

PrepareTestContainer creates a container with Golang and installs gotestsum and gotestdox

Return Type
Container !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 prepare-test-container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Golang().
			Preparetestcontainer()
}
@function
def example() -> dagger.Container:
	return (
		dag.golang()
		.preparetestcontainer()
	)
@func()
example(): Container {
	return dag
		.golang()
		.prepareTestContainer()
}

testGitHub() 🔗

TestGitHub runs Go tests on a GitHub repository

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-The GitHub repository name (e.g., "username/repo")
gitRefString !-The git reference (branch, tag, or commit) to clone and test
args[String ! ] -An optional slice of strings representing additional arguments to the go test command
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/golang@a9d74052bd6207538cdf048bf7074d8b377ae51b call \
 test-git-hub --repository string --git-ref string
func (m *MyModule) Example(ctx context.Context, repository string, gitRef string) string  {
	return dag.
			Golang().
			Testgithub(ctx, repository, gitRef)
}
@function
async def example(repository: str, gitref: str) -> str:
	return await (
		dag.golang()
		.testgithub(repository, gitref)
	)
@func()
async example(repository: string, gitRef: string): Promise<string> {
	return dag
		.golang()
		.testGitHub(repository, gitRef)
}