golang

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package golang provides a simple interface for building and testing Go projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainer

func GetContainer(
	ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config],
) (*dagger.Container, error)

GetContainer returns a dagger container with given working directory and options.

func RunCommand

func RunCommand(
	ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config],
) (string, *dagger.Directory, error)

RunCommand runs a go command with given working directory and options and returns command output and working directory.

func WithArgs

func WithArgs(args ...string) daggers.Option[config]

WithArgs sets the arguments to pass to go.

func WithContainerCustomizers

func WithContainerCustomizers(customizers ...containers.ContainerCustomizerFn) daggers.Option[config]

WithContainerCustomizers adds the container customizers to use for the container.

func WithEnv

func WithEnv(envMap map[string]string) daggers.Option[config]

WithEnv sets the environment variables to pass to go.

func WithGoImageRepo

func WithGoImageRepo(repo string) daggers.Option[config]

WithGoImageRepo sets whether to enable go module caching. Optional, defaults to docker.io/golang.

func WithGoImageTag

func WithGoImageTag(tag string) daggers.Option[config]

WithGoImageTag sets the go image tag to use for the container. Optional, defaults to 1.19.

func WithGoModCacheEnabled

func WithGoModCacheEnabled(enable bool) daggers.Option[config]

WithGoModCacheEnabled sets whether to enable go module caching. Optional, defaults to true.

func WithGoModDir

func WithGoModDir(dir string) daggers.Option[config]

WithGoModDir sets the go module directory to use for the container. Optional, defaults to the current directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL