A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/arduino/arduino-cli/commit/c5812eea68afdb0e4e774f4f15ec4a34f0c3100c below:

list return empty array instead of null, when no cores are inst… · arduino/arduino-cli@c5812ee · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+4

-3

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+4

-3

lines changed Original file line number Diff line number Diff line change

@@ -88,9 +88,9 @@ func GetList(ctx context.Context, srv rpc.ArduinoCoreServiceServer, inst *rpc.In

88 88

}

89 89 90 90

func newCoreListResult(in []*rpc.PlatformSummary, updatableOnly bool) *coreListResult {

91 -

res := &coreListResult{updatableOnly: updatableOnly}

92 -

for _, platformSummary := range in {

93 -

res.Platforms = append(res.Platforms, result.NewPlatformSummary(platformSummary))

91 +

res := &coreListResult{updatableOnly: updatableOnly, Platforms: make([]*result.PlatformSummary, len(in))}

92 +

for i, platformSummary := range in {

93 +

res.Platforms[i] = result.NewPlatformSummary(platformSummary)

94 94

}

95 95

return res

96 96

}

Original file line number Diff line number Diff line change

@@ -1174,6 +1174,7 @@ func TestCoreListWhenNoPlatformAreInstalled(t *testing.T) {

1174 1174

stdout, _, err := cli.Run("core", "list", "--json")

1175 1175

require.NoError(t, err)

1176 1176

requirejson.Query(t, stdout, `.platforms | length`, `0`)

1177 +

requirejson.Query(t, stdout, `.platforms | select(.!=null)`, `[]`)

1177 1178 1178 1179

stdout, _, err = cli.Run("core", "list")

1179 1180

require.NoError(t, err)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4