AddGoApp
Method
func (DistributedApplicationBuilder) AddGoApp( name string, appDirectory string, options ...*AddGoAppOptions,) GoAppResourceSignature
method
AddGoApp builderAdds a Go application to the application model. The Go toolchain must be available on the PATH.
AddGoApp( name string, appDirectory string, options ...*AddGoAppOptions,) GoAppResourceParameters
namestringThe name of the resource.appDirectory stringThe path to the directory that acts as both the Go module root (where go.mod lives) and the Docker build context for aspire publish.options...*AddGoAppOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddGoAppOptions argument.
PackagePath *stringThe Go package to run or build, relative to appDirectory . Defaults to "." (the module root itself). Use a sub-path such as "./cmd/server" when the main package is not at the module root (e.g. api/cmd/server/main.go with api/go.mod ). This value is passed to go run, dlv debug, and go build consistently.BuildTags []string Optional build tags passed to the compiler via -tags (e.g. "netgo", "integration").LdFlags *stringOptional linker flags passed via -ldflags (e.g. "-X main.version=1.0.0" ).GcFlags *stringOptional compiler flags passed via -gcflags (e.g. "all=-N -l" to disable optimisations for Delve).RaceDetector *boolWhen true, enables the Go race detector by passing -race to go run.Returns
GoAppResource The resource builder.
Returns a handle; failures surface later via Err().
Applies to
This method applies to the following types:
type
DistributedApplicationBuilder