addGoApp
Method
interface IDistributedApplicationBuilder { // ... omitted for brevity addGoApp( name: string, appDirectory: string, packagePath?: string, buildTags?: string[], ldFlags?: string, gcFlags?: string, raceDetector?: boolean): GoAppResource;}Signature
method
addGoApp builderAdds a Go application to the application model. The Go toolchain must be available on the PATH.
addGoApp( name: string, appDirectory: string, packagePath?: string, buildTags?: string[], ldFlags?: string, gcFlags?: string, raceDetector?: boolean): 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`.packagePath stringoptional= .The 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[]optionalOptional build tags passed to the compiler via `-tags` (e.g. `"netgo"`, `"integration"`).ldFlags stringoptionalOptional linker flags passed via `-ldflags` (e.g. `"-X main.version=1.0.0"`).gcFlags stringoptionalOptional compiler flags passed via `-gcflags` (e.g. `"all=-N -l"` to disable optimisations for Delve).raceDetector booleanoptional= FalseWhen `true`, enables the Go race detector by passing `-race` to `go run`.Returns
GoAppResource Applies to
This method applies to the following types: