Skip to main content
Version: Next

go CLI reference

ModularPipelines.Go provides strongly typed access to the go CLI.

Executable prerequisite

This package does not install the go executable. Install it separately and ensure go is available on PATH.

Follow the executable's official documentation for installation instructions.

Package installation

dotnet add package ModularPipelines.Go

Resolve the service with context.Tools.Go. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.Go.Services.IGo>() instead.

Module example

using ModularPipelines;
using ModularPipelines.Go.Options;

public class RunCommandModule : Module<CommandResult>
{
protected override async Task<CommandResult> ExecuteAsync(
IModuleContext context,
CancellationToken cancellationToken)
{
return await context.Tools.Go.VetAsync(
new GoVetOptions(),
cancellationToken: cancellationToken);
}
}

Commands

CLI commandOptions record
go bugGoBugOptions
go buildGoBuildOptions
go cleanGoCleanOptions
go docGoDocOptions
go envGoEnvOptions
go fixGoFixOptions
go fmtGoFmtOptions
go generateGoGenerateOptions
go getGoGetOptions
go installGoInstallOptions
go listGoListOptions
go modGoModOptions
go mod downloadGoModDownloadOptions
go mod editGoModEditOptions
go mod graphGoModGraphOptions
go mod initGoModInitOptions
go mod tidyGoModTidyOptions
go mod vendorGoModVendorOptions
go mod verifyGoModVerifyOptions
go mod whyGoModWhyOptions
go runGoRunOptions
go telemetryGoTelemetryOptions
go testGoTestOptions
go toolGoToolOptions
go versionGoVersionOptions
go vetGoVetOptions
go workGoWorkOptions
go work editGoWorkEditOptions
go work initGoWorkInitOptions
go work syncGoWorkSyncOptions
go work useGoWorkUseOptions
go work vendorGoWorkVendorOptions