Skip to content

Commit c4cc05a

Browse files
Fix comments on functions to make them clearer
1 parent a2bd24f commit c4cc05a

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Diff for: arduino/httpclient/httpclient.go

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var tr = i18n.Tr
3333

3434
// DownloadFile downloads a file from a URL into the specified path. An optional config and options may be passed (or nil to use the defaults).
3535
// A DownloadProgressCB callback function must be passed to monitor download progress.
36+
// If a not empty queryParameter is passed, it is appended to the URL for analysis purposes.
3637
func DownloadFile(path *paths.Path, URL string, queryParameter string, label string, downloadCB rpc.DownloadProgressCB, config *downloader.Config, options ...downloader.DownloadOptions) (returnedError error) {
3738
if queryParameter != "" {
3839
URL = URL + "?query=" + queryParameter

Diff for: arduino/resources/download.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
// Download performs a download loop using the provided downloader.Config.
2929
// Messages are passed back to the DownloadProgressCB using label as text for the File field.
30+
// queryParameter is passed for analysis purposes.
3031
func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config, label string, downloadCB rpc.DownloadProgressCB, queryParameter string) error {
3132
path, err := r.ArchivePath(downloadDir)
3233
if err != nil {

Diff for: commands/lib/download.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import (
3030

3131
var tr = i18n.Tr
3232

33-
// LibraryDownload FIXMEDOC
33+
// LibraryDownload executes the download of the library.
34+
// A DownloadProgressCB callback function must be passed to monitor download progress.
35+
// queryParameter is passed for analysis purposes.
3436
func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downloadCB rpc.DownloadProgressCB, queryParameter string) (*rpc.LibraryDownloadResponse, error) {
3537
logrus.Info("Executing `arduino-cli lib download`")
3638

Diff for: commands/lib/install.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import (
3030
"github.com/sirupsen/logrus"
3131
)
3232

33-
// LibraryInstall FIXMEDOC
33+
// LibraryInstall resolves the library dependencies, then downloads and installs the libraries into the install location.
34+
// queryParameter is passed for analysis purposes and forwarded to the called functions. It is set to "depends" when a dependency is installed
3435
func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB, queryParameter string) error {
3536
lm := commands.GetLibraryManager(req)
3637
if lm == nil {
@@ -96,6 +97,7 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloa
9697
}
9798

9899
for libRelease, installTask := range libReleasesToInstall {
100+
// Checks if libRelease is the requested library and not a dependency
99101
if libRelease.GetName() == req.Name {
100102
if err := downloadLibrary(lm, libRelease, downloadCB, taskCB, queryParameter); err != nil {
101103
return err

0 commit comments

Comments
 (0)