Skip to content

Commit 4916a1e

Browse files
committed
Refactor variable declarations in Build function for clarity
- Changed slice initializations from shorthand to explicit var declarations for clientOpts, exportsWithOutput, and platformStrings. - This improves readability and maintains consistency in the code style.
1 parent 989fc2b commit 4916a1e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/build/build.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func Build(ctx context.Context, opts *BOpts) error {
4444
grpc.MaxCallSendMsgSize(512<<20), // 512MB
4545
),
4646
}
47-
clientOpts := []client.ClientOpt{}
47+
var clientOpts []client.ClientOpt
4848
for _, opt := range grpcOpts {
4949
clientOpts = append(clientOpts, client.WithGRPCDialOption(opt))
5050
}
@@ -86,7 +86,7 @@ func Build(ctx context.Context, opts *BOpts) error {
8686
dest: outputPath,
8787
}
8888

89-
exportsWithOutput := []client.ExportEntry{}
89+
var exportsWithOutput []client.ExportEntry
9090
for _, export := range exports {
9191
switch export.Type {
9292
case client.ExporterLocal:
@@ -142,7 +142,7 @@ func Build(ctx context.Context, opts *BOpts) error {
142142
solveOpt.FrontendAttrs["build-arg:"+k] = v
143143
}
144144

145-
platformStrings := []string{}
145+
var platformStrings []string
146146
for _, platform := range opts.Platforms {
147147
platformStrings = append(platformStrings, platforms.Format(platforms.Normalize(platform)))
148148
}

0 commit comments

Comments
 (0)