Skip to main content
Version: Next

go CLI reference

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

Installation

dotnet add package ModularPipelines.Go

Resolve the service with context.Tools.Go. For projects older than C# 14, import ModularPipelines.Go.Extensions and use the context.Go() extension method as a compatibility fallback.

Module example

using ModularPipelines.Context;
using ModularPipelines.Models;
using ModularPipelines.Modules;
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 buildGoBuildOptions
go fixGoFixOptions
go generateGoGenerateOptions
go testGoTestOptions
go vetGoVetOptions