Skip to content

Commit a3d9b70

Browse files
committed
Made utility functions private and put them in their own file
1 parent 8d3dafa commit a3d9b70

14 files changed

+22
-22
lines changed

commands/service_board_listall.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ func (s *arduinoCoreServerImpl) BoardListAll(ctx context.Context, req *rpc.Board
4646
}
4747

4848
rpcPlatform := &rpc.Platform{
49-
Metadata: PlatformToRPCPlatformMetadata(platform),
50-
Release: PlatformReleaseToRPC(installedPlatformRelease),
49+
Metadata: platformToRPCPlatformMetadata(platform),
50+
Release: platformReleaseToRPC(installedPlatformRelease),
5151
}
5252

5353
toTest := []string{

commands/service_board_search.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ func (s *arduinoCoreServerImpl) BoardSearch(ctx context.Context, req *rpc.BoardS
6767
Fqbn: board.FQBN(),
6868
IsHidden: board.IsHidden(),
6969
Platform: &rpc.Platform{
70-
Metadata: PlatformToRPCPlatformMetadata(platform),
71-
Release: PlatformReleaseToRPC(installedPlatformRelease),
70+
Metadata: platformToRPCPlatformMetadata(platform),
71+
Release: platformReleaseToRPC(installedPlatformRelease),
7272
},
7373
})
7474
}
@@ -82,8 +82,8 @@ func (s *arduinoCoreServerImpl) BoardSearch(ctx context.Context, req *rpc.BoardS
8282
foundBoards = append(foundBoards, &rpc.BoardListItem{
8383
Name: strings.Trim(board.Name, " \n"),
8484
Platform: &rpc.Platform{
85-
Metadata: PlatformToRPCPlatformMetadata(platform),
86-
Release: PlatformReleaseToRPC(latestPlatformRelease),
85+
Metadata: platformToRPCPlatformMetadata(platform),
86+
Release: platformReleaseToRPC(latestPlatformRelease),
8787
},
8888
})
8989
}

commands/service_library_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (s *arduinoCoreServerImpl) LibraryDownload(req *rpc.LibraryDownloadRequest,
5656
return err
5757
}
5858

59-
version, err := ParseVersion(req.GetVersion())
59+
version, err := parseVersion(req.GetVersion())
6060
if err != nil {
6161
return err
6262
}

commands/service_library_install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (s *arduinoCoreServerImpl) LibraryInstall(req *rpc.LibraryInstallRequest, s
109109
libReleasesToInstall := map[*librariesindex.Release]*librariesmanager.LibraryInstallPlan{}
110110
installLocation := libraries.FromRPCLibraryInstallLocation(req.GetInstallLocation())
111111
for _, lib := range toInstall {
112-
version, err := ParseVersion(lib.GetVersionRequired())
112+
version, err := parseVersion(lib.GetVersionRequired())
113113
if err != nil {
114114
return err
115115
}

commands/service_library_resolve_deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (s *arduinoCoreServerImpl) LibraryResolveDependencies(ctx context.Context,
4747

4848
func libraryResolveDependencies(lme *librariesmanager.Explorer, li *librariesindex.Index,
4949
reqName, reqVersion string, noOverwrite bool) (*rpc.LibraryResolveDependenciesResponse, error) {
50-
version, err := ParseVersion(reqVersion)
50+
version, err := parseVersion(reqVersion)
5151
if err != nil {
5252
return nil, err
5353
}

commands/service_library_uninstall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (s *arduinoCoreServerImpl) LibraryUninstall(req *rpc.LibraryUninstallReques
4747
return err
4848
}
4949

50-
version, err := ParseVersion(req.GetVersion())
50+
version, err := parseVersion(req.GetVersion())
5151
if err != nil {
5252
return err
5353
}

commands/service_platform_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (s *arduinoCoreServerImpl) PlatformDownload(req *rpc.PlatformDownloadReques
4848
}
4949
defer release()
5050

51-
version, err := ParseVersion(req.GetVersion())
51+
version, err := parseVersion(req.GetVersion())
5252
if err != nil {
5353
return &cmderrors.InvalidVersionError{Cause: err}
5454
}

commands/service_platform_install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s *arduinoCoreServerImpl) PlatformInstall(req *rpc.PlatformInstallRequest,
5353
}
5454
defer release()
5555

56-
version, err := ParseVersion(req.GetVersion())
56+
version, err := parseVersion(req.GetVersion())
5757
if err != nil {
5858
return &cmderrors.InvalidVersionError{Cause: err}
5959
}

commands/service_platform_search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (s *arduinoCoreServerImpl) PlatformSearch(_ context.Context, req *rpc.Platf
8282
out := []*rpc.PlatformSummary{}
8383
for _, platform := range res {
8484
rpcPlatformSummary := &rpc.PlatformSummary{
85-
Metadata: PlatformToRPCPlatformMetadata(platform),
85+
Metadata: platformToRPCPlatformMetadata(platform),
8686
Releases: map[string]*rpc.PlatformRelease{},
8787
}
8888
if installed := pme.GetInstalledPlatformRelease(platform); installed != nil {
@@ -92,7 +92,7 @@ func (s *arduinoCoreServerImpl) PlatformSearch(_ context.Context, req *rpc.Platf
9292
rpcPlatformSummary.LatestVersion = latestCompatible.Version.String()
9393
}
9494
for _, platformRelease := range platform.GetAllReleases() {
95-
rpcPlatformRelease := PlatformReleaseToRPC(platformRelease)
95+
rpcPlatformRelease := platformReleaseToRPC(platformRelease)
9696
rpcPlatformSummary.Releases[rpcPlatformRelease.GetVersion()] = rpcPlatformRelease
9797
}
9898
out = append(out, rpcPlatformSummary)

commands/service_platform_upgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func (s *arduinoCoreServerImpl) PlatformUpgrade(req *rpc.PlatformUpgradeRequest,
7676
if platformRelease != nil {
7777
syncSend.Send(&rpc.PlatformUpgradeResponse{
7878
Platform: &rpc.Platform{
79-
Metadata: PlatformToRPCPlatformMetadata(platformRelease.Platform),
80-
Release: PlatformReleaseToRPC(platformRelease),
79+
Metadata: platformToRPCPlatformMetadata(platformRelease.Platform),
80+
Release: platformReleaseToRPC(platformRelease),
8181
},
8282
})
8383
}

0 commit comments

Comments
 (0)