Documentation
¶
Index ¶
- type Cli
- func (cli *Cli) Build(ctx context.Context, projectDir string, outputName string, env []string) error
- func (cli *Cli) CheckInstalled(ctx context.Context) error
- func (cli *Cli) InstallUrl() string
- func (cli *Cli) ModDownload(ctx context.Context, projectDir string, env []string) error
- func (cli *Cli) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
Cli wraps the Go CLI for building Go projects.
func NewCli ¶
func NewCli(commandRunner exec.CommandRunner) *Cli
NewCli creates a new instance of the Go CLI wrapper.
func (*Cli) Build ¶
func (cli *Cli) Build( ctx context.Context, projectDir string, outputName string, env []string, ) error
Build compiles the Go project at the given directory, outputting the binary with the specified name. Environment variables are passed to the build command to support cross-compilation.
func (*Cli) CheckInstalled ¶
CheckInstalled verifies Go is installed and meets the minimum version.
func (*Cli) InstallUrl ¶
InstallUrl returns the URL for installing Go.
func (*Cli) ModDownload ¶
ModDownload runs 'go mod download' to fetch dependencies.
Click to show internal directories.
Click to hide internal directories.