Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ namespace Aspire.Hosting;
/// </summary>
public static class GolangAppHostingExtension
{
/// <summary>
/// Adds a Golang application to the application model. Executes the executable Golang app.
/// </summary>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/> to add the resource to.</param>
/// <param name="name">The name of the resource.</param>
/// <param name="workingDirectory">The working directory to use for the command. If null, the working directory of the current process is used.</param>
/// <param name="args">The optinal arguments to be passed to the executable when it is started.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string workingDirectory, string[] args)
=> AddGolangApp(builder, name, workingDirectory, args);

/// <summary>
/// Adds a Golang application to the application model. Executes the executable Golang app.
/// </summary>
Expand Down Expand Up @@ -43,7 +54,7 @@ public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(this ID

return builder.AddResource(resource)
.WithGolangDefaults()
.WithArgs(allArgs.ToArray());
.WithArgs([.. allArgs]);
}

private static IResourceBuilder<GolangAppExecutableResource> WithGolangDefaults(
Expand Down
Loading