GoHostingExtensions
Classstaticnet10.0
Provides extension methods for adding Go applications to an
Hosting.IDistributedApplicationBuilder . namespace Aspire.Hosting;
public static class GoHostingExtensions{ // ...}10 members
Methods10
Section titled MethodsAddGoApp(IDistributedApplicationBuilder, string, string, string, string[]?, string?, string?, bool) extensionats exportIResourceBuilder<GoAppResource> Adds a Go application to the application model. The Go toolchain must be available on the PATH.
IResourceBuilder<T> Passes extra arguments to the Go program at runtime. In normal run mode they appear after
go run .; in Delve mode after the -- separator. IResourceBuilder<T> Starts a headless Delve debug server so that a DAP-compatible client can attach remotely. The application is launched with
dlv debug instead of go run. Delve must be available on the PATH. IResourceBuilder<T> Starts a headless Delve debug server on the specified port.
IResourceBuilder<T> Starts a configurable headless Delve debug server so that DAP-compatible clients can attach remotely. The application is launched with
dlv debug instead of go run. Delve must be available on the PATH. IResourceBuilder<T> Configures private Go module authentication for publish-time Dockerfile generation.
IResourceBuilder<T> Runs
go mod download before starting the application, pre-fetching all module dependencies into the local module cache without modifying go.sum . The main application waits for the download step to complete successfully before launching. IResourceBuilder<T> Runs
go mod tidy before starting the application, ensuring go.sum is up to date. The main application waits for the tidy step to complete successfully before launching. IResourceBuilder<T> Runs
go mod vendor before starting the application, caching all module dependencies in the local vendor/ directory. The main application waits for the vendor step to complete successfully before launching. IResourceBuilder<T> Runs
go vet ./... before starting the application to catch static analysis issues. The main application waits for the vet step to complete successfully before launching.