Skip to content

Commit faf2973

Browse files
authored
Adding API fix to avoid breaking changes (#745)
* Adding API fix to avoid breaking changes * shouldn't ahve changed that
1 parent 0227826 commit faf2973

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/CommunityToolkit.Aspire.Hosting.Golang/GolangAppHostingExtension.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ namespace Aspire.Hosting;
88
/// </summary>
99
public static class GolangAppHostingExtension
1010
{
11+
/// <summary>
12+
/// Adds a Golang application to the application model. Executes the executable Golang app.
13+
/// </summary>
14+
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/> to add the resource to.</param>
15+
/// <param name="name">The name of the resource.</param>
16+
/// <param name="workingDirectory">The working directory to use for the command. If null, the working directory of the current process is used.</param>
17+
/// <param name="args">The optinal arguments to be passed to the executable when it is started.</param>
18+
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
19+
public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string workingDirectory, string[] args)
20+
=> AddGolangApp(builder, name, workingDirectory, args);
21+
1122
/// <summary>
1223
/// Adds a Golang application to the application model. Executes the executable Golang app.
1324
/// </summary>
@@ -43,7 +54,7 @@ public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(this ID
4354

4455
return builder.AddResource(resource)
4556
.WithGolangDefaults()
46-
.WithArgs(allArgs.ToArray());
57+
.WithArgs([.. allArgs]);
4758
}
4859

4960
private static IResourceBuilder<GolangAppExecutableResource> WithGolangDefaults(

0 commit comments

Comments
 (0)