diff --git a/arduino/cores/tools.go b/arduino/cores/tools.go index 69611fd3d34..10d718464ad 100644 --- a/arduino/cores/tools.go +++ b/arduino/cores/tools.go @@ -30,7 +30,7 @@ import ( // Tool represents a single Tool, part of a Package. type Tool struct { Name string `json:"name,required"` // The Name of the Tool. - Releases map[string]*ToolRelease `json:"releases"` //Maps Version to Release. + Releases map[string]*ToolRelease `json:"releases"` // Maps Version to Release. Package *Package `json:"-"` } diff --git a/builder_client_helpers/alive.go b/builder_client_helpers/alive.go index 767f16b2a44..65dee165453 100644 --- a/builder_client_helpers/alive.go +++ b/builder_client_helpers/alive.go @@ -38,7 +38,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er return c.Client.Do(ctx, req) } -// NewPingAliveRequest create the request corresponding to the ping action endpoint of the alive resource. +// NewPingAliveRequest creates the request corresponding to the ping action endpoint of the alive resource. func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/boards.go b/builder_client_helpers/boards.go index 75ceb336362..58060ee622c 100644 --- a/builder_client_helpers/boards.go +++ b/builder_client_helpers/boards.go @@ -38,7 +38,7 @@ func (c *Client) ListBoards(ctx context.Context, path string) (*http.Response, e return c.Client.Do(ctx, req) } -// NewListBoardsRequest create the request corresponding to the list action endpoint of the boards resource. +// NewListBoardsRequest creates the request corresponding to the list action endpoint of the boards resource. func (c *Client) NewListBoardsRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -69,7 +69,7 @@ func (c *Client) ShowBoards(ctx context.Context, path string) (*http.Response, e return c.Client.Do(ctx, req) } -// NewShowBoardsRequest create the request corresponding to the show action endpoint of the boards resource. +// NewShowBoardsRequest creates the request corresponding to the show action endpoint of the boards resource. func (c *Client) NewShowBoardsRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/boards_v2.go b/builder_client_helpers/boards_v2.go index 957e536b701..9e889ee9194 100644 --- a/builder_client_helpers/boards_v2.go +++ b/builder_client_helpers/boards_v2.go @@ -33,7 +33,7 @@ func ByVidPidBoardsV2Path(vid string, pid string) string { return fmt.Sprintf("/builder/v2/boards/byVidPid/%s/%s", param0, param1) } -// Provides the board identified by the :vid and :pid params. Doesn't require authentication. +// ByVidPidBoardsV2 provides the board identified by the :vid and :pid params. Doesn't require authentication. func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewByVidPidBoardsV2Request(ctx, path) if err != nil { @@ -42,7 +42,7 @@ func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Respo return c.Client.Do(ctx, req) } -// NewByVidPidBoardsV2Request create the request corresponding to the byVidPid action endpoint of the boards_v2 resource. +// NewByVidPidBoardsV2Request creates the request corresponding to the byVidPid action endpoint of the boards_v2 resource. func (c *Client) NewByVidPidBoardsV2Request(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -62,7 +62,7 @@ func ListBoardsV2Path() string { return fmt.Sprintf("/builder/v2/boards") } -// Provides a list of all the boards supported by Arduino Create. Doesn't require any authentication. +// ListBoardsV2 provides a list of all the boards supported by Arduino Create. Doesn't require any authentication. func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offset *int) (*http.Response, error) { req, err := c.NewListBoardsV2Request(ctx, path, limit, offset) if err != nil { @@ -71,7 +71,7 @@ func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offs return c.Client.Do(ctx, req) } -// NewListBoardsV2Request create the request corresponding to the list action endpoint of the boards_v2 resource. +// NewListBoardsV2Request creates the request corresponding to the list action endpoint of the boards_v2 resource. func (c *Client) NewListBoardsV2Request(ctx context.Context, path string, limit *int, offset *int) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -102,7 +102,7 @@ func ShowBoardsV2Path(fqbn string) string { return fmt.Sprintf("/builder/v2/boards/%s", param0) } -// Provides the board identified by an fqbn. Doesn't require authentication. +// ShowBoardsV2 provides the board identified by an fqbn. Doesn't require authentication. func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewShowBoardsV2Request(ctx, path) if err != nil { @@ -111,7 +111,7 @@ func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response, return c.Client.Do(ctx, req) } -// NewShowBoardsV2Request create the request corresponding to the show action endpoint of the boards_v2 resource. +// NewShowBoardsV2Request creates the request corresponding to the show action endpoint of the boards_v2 resource. func (c *Client) NewShowBoardsV2Request(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/compilations.go b/builder_client_helpers/compilations.go index 3f025786160..1cda1bd5299 100644 --- a/builder_client_helpers/compilations.go +++ b/builder_client_helpers/compilations.go @@ -42,7 +42,7 @@ func (c *Client) StartCompilations(ctx context.Context, path string, payload *Co return c.Client.Do(ctx, req) } -// NewStartCompilationsRequest create the request corresponding to the start action endpoint of the compilations resource. +// NewStartCompilationsRequest creates the request corresponding to the start action endpoint of the compilations resource. func (c *Client) NewStartCompilationsRequest(ctx context.Context, path string, payload *Compilation) (*http.Request, error) { var body bytes.Buffer err := c.Encoder.Encode(payload, &body, "*/*") diff --git a/builder_client_helpers/examples.go b/builder_client_helpers/examples.go index e56a598abf3..137f297cdaf 100644 --- a/builder_client_helpers/examples.go +++ b/builder_client_helpers/examples.go @@ -38,7 +38,7 @@ func (c *Client) ListExamples(ctx context.Context, path string, maintainer *stri return c.Client.Do(ctx, req) } -// NewListExamplesRequest create the request corresponding to the list action endpoint of the examples resource. +// NewListExamplesRequest creates the request corresponding to the list action endpoint of the examples resource. func (c *Client) NewListExamplesRequest(ctx context.Context, path string, maintainer *string, libType *string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/files.go b/builder_client_helpers/files.go index fe6fef3cb23..f6d105b71ba 100644 --- a/builder_client_helpers/files.go +++ b/builder_client_helpers/files.go @@ -38,7 +38,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er return c.Client.Do(ctx, req) } -// NewShowFilesRequest create the request corresponding to the show action endpoint of the files resource. +// NewShowFilesRequest creates the request corresponding to the show action endpoint of the files resource. func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/libraries.go b/builder_client_helpers/libraries.go index 73a0539c954..a6866059308 100644 --- a/builder_client_helpers/libraries.go +++ b/builder_client_helpers/libraries.go @@ -42,7 +42,7 @@ func (c *Client) ListLibraries( return c.Client.Do(ctx, req) } -// NewListLibrariesRequest create the request corresponding to the list action endpoint of the libraries resource. +// NewListLibrariesRequest creates the request corresponding to the list action endpoint of the libraries resource. func (c *Client) NewListLibrariesRequest(ctx context.Context, path string, maintainer *string, libType *string, withoutType *string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -73,7 +73,7 @@ func ShowLibrariesPath(id string) string { } // ShowLibraries provides the library identified by the :id and :pid param. Doesn't require authentication. -// Also contains a list of other versions of the library +// Also contains a list of other versions of the library. func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewShowLibrariesRequest(ctx, path) if err != nil { @@ -82,7 +82,7 @@ func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response return c.Client.Do(ctx, req) } -// NewShowLibrariesRequest create the request corresponding to the show action endpoint of the libraries resource. +// NewShowLibrariesRequest creates the request corresponding to the show action endpoint of the libraries resource. func (c *Client) NewShowLibrariesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/builder_client_helpers/pinned_libraries.go b/builder_client_helpers/pinned_libraries.go index 37ba77a0374..3360c646ea8 100644 --- a/builder_client_helpers/pinned_libraries.go +++ b/builder_client_helpers/pinned_libraries.go @@ -31,7 +31,7 @@ func AddPinnedLibrariesPath(id string) string { return fmt.Sprintf("/builder/pinned/%s", param0) } -//AddPinnedLibraries adds a new library to the list of libraries pinned by the user +// AddPinnedLibraries adds a new library to the list of libraries pinned by the user func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewAddPinnedLibrariesRequest(ctx, path) if err != nil { @@ -40,7 +40,7 @@ func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Res return c.Client.Do(ctx, req) } -// NewAddPinnedLibrariesRequest create the request +// NewAddPinnedLibrariesRequest creates the request // corresponding to the add action endpoint of the pinnedLibraries resource. func (c *Client) NewAddPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme @@ -63,7 +63,7 @@ func ListPinnedLibrariesPath() string { return fmt.Sprintf("/builder/pinned") } -//ListPinnedLibraries provides a list of all the libraries pinned by the user +// ListPinnedLibraries provides a list of all the libraries pinned by the user func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewListPinnedLibrariesRequest(ctx, path) if err != nil { @@ -72,7 +72,7 @@ func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Re return c.Client.Do(ctx, req) } -// NewListPinnedLibrariesRequest create the request corresponding to the list action endpoint of the pinnedLibraries resource. +// NewListPinnedLibrariesRequest creates the request corresponding to the list action endpoint of the pinnedLibraries resource. func (c *Client) NewListPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -96,7 +96,7 @@ func RemovePinnedLibrariesPath(id string) string { return fmt.Sprintf("/builder/pinned/%s", param0) } -//RemovePinnedLibraries removes a library to the list of libraries pinned by the user +// RemovePinnedLibraries removes a library to the list of libraries pinned by the user func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewRemovePinnedLibrariesRequest(ctx, path) if err != nil { @@ -105,7 +105,7 @@ func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http. return c.Client.Do(ctx, req) } -// NewRemovePinnedLibrariesRequest create the request corresponding to the remove action endpoint of the pinnedLibraries resource. +// NewRemovePinnedLibrariesRequest creates the request corresponding to the remove action endpoint of the pinnedLibraries resource. func (c *Client) NewRemovePinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/commands/commands.go b/commands/commands.go index 9188bebf18f..19a8976d9b6 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -105,7 +105,7 @@ func InitPackageManager() *packagemanager.PackageManager { return pm } -// InitLibraryManager initialize the LibraryManager using the underlying packagemanager +// InitLibraryManager initializes the LibraryManager using the underlying packagemanager func InitLibraryManager(pm *packagemanager.PackageManager) *librariesmanager.LibrariesManager { logrus.Info("Starting libraries manager") lm := librariesmanager.NewLibraryManager( diff --git a/commands/generatedocs/generatedocs.go b/commands/generatedocs/generatedocs.go index 50b74727607..62f53dcd86c 100644 --- a/commands/generatedocs/generatedocs.go +++ b/commands/generatedocs/generatedocs.go @@ -65,7 +65,7 @@ func generateBashCompletions(cmd *cobra.Command, args []string) { } } -// Generate man pages for all commands and puts them in $PROJECT_DIR/docs/manpages. +// Generates man pages for all commands and puts them in $PROJECT_DIR/docs/manpages. func generateManPages(cmd *cobra.Command, args []string) { if outputDir == "" { outputDir = "docs/manpages" diff --git a/common/formatter/README.adoc b/common/formatter/README.adoc index 79251d0b1cb..080ef6f44db 100644 --- a/common/formatter/README.adoc +++ b/common/formatter/README.adoc @@ -27,11 +27,11 @@ var test TestType{ var testString = a.Format(test) fmt.Println(testString) // Prints test.String() -a.Print(test) //does the same. +a.Print(test) // Does the same. testString = b.Format(test) fmt.Println(testString) // Prints { field1 : "test", field2 : "42" } -b.Print(test) //Does the same +b.Print(test) // Does the same ---- === The default formatter diff --git a/common/formatter/output/common_structs.go b/common/formatter/output/common_structs.go index 5ec55e84861..7ba92248c77 100644 --- a/common/formatter/output/common_structs.go +++ b/common/formatter/output/common_structs.go @@ -22,7 +22,7 @@ import ( "strings" ) -//ProcessResult contains info about a completed process. +// ProcessResult contains info about a completed process. type ProcessResult struct { ItemName string `json:"name,required"` Status string `json:"status,omitempty"` diff --git a/create_client_helpers/alive.go b/create_client_helpers/alive.go index 311c57d4a0b..e5a33f2e6b7 100644 --- a/create_client_helpers/alive.go +++ b/create_client_helpers/alive.go @@ -30,7 +30,7 @@ func PingAlivePath() string { return fmt.Sprintf("/create/alive") } -// Returns 200 if the instance is healthy +// Returns 200 if the instance is healthy. func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewPingAliveRequest(ctx, path) if err != nil { @@ -39,7 +39,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er return c.Client.Do(ctx, req) } -// NewPingAliveRequest create the request corresponding to the ping action endpoint of the alive resource. +// NewPingAliveRequest creates the request corresponding to the ping action endpoint of the alive resource. func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/create_client_helpers/files.go b/create_client_helpers/files.go index 81d02b6a767..c895c6fc76d 100644 --- a/create_client_helpers/files.go +++ b/create_client_helpers/files.go @@ -33,7 +33,7 @@ func ShowFilesPath(fileType string, id string, name string) string { return fmt.Sprintf("/create/v1/files/%s/%s/%s", param0, param1, param2) } -// Provides the content of the file identified by :name and :id +// ShowFiles provides the content of the file identified by :name and :id. func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewShowFilesRequest(ctx, path) if err != nil { @@ -42,7 +42,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er return c.Client.Do(ctx, req) } -// NewShowFilesRequest create the request corresponding to the show action endpoint of the files resource. +// NewShowFilesRequest creates the request corresponding to the show action endpoint of the files resource. func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/create_client_helpers/sketches.go b/create_client_helpers/sketches.go index db3171fbaf1..5fdfd861859 100644 --- a/create_client_helpers/sketches.go +++ b/create_client_helpers/sketches.go @@ -36,7 +36,7 @@ const ( prod = true ) -// CreateSketches Adds a new sketch. +// CreateSketches adds a new sketch. func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) { req, err := c.NewCreateSketchesRequest(ctx, path, payload, authorization) if err != nil { @@ -45,7 +45,7 @@ func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketc return c.Client.Do(ctx, req) } -// NewCreateSketchesRequest create the request corresponding to the create action endpoint of the sketches resource. +// NewCreateSketchesRequest creates the request corresponding to the create action endpoint of the sketches resource. func (c *Client) NewCreateSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) { var body bytes.Buffer err := c.Encoder.Encode(payload, &body, "*/*") @@ -79,7 +79,7 @@ func DeleteSketchesPath(id string) string { return fmt.Sprintf("/create/v1/sketches/%s", id) } -// DeleteSketches Removes the sketch identified by the :id param. +// DeleteSketches removes the sketch identified by the :id param. func (c *Client) DeleteSketches(ctx context.Context, path string, authorization string) (*http.Response, error) { req, err := c.NewDeleteSketchesRequest(ctx, path, authorization) if err != nil { @@ -88,7 +88,7 @@ func (c *Client) DeleteSketches(ctx context.Context, path string, authorization return c.Client.Do(ctx, req) } -// NewDeleteSketchesRequest create the request corresponding to the delete action endpoint of the sketches resource. +// NewDeleteSketchesRequest creates the request corresponding to the delete action endpoint of the sketches resource. func (c *Client) NewDeleteSketchesRequest(ctx context.Context, path string, authorization string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -118,7 +118,7 @@ func EditSketchesPath(id string) string { return fmt.Sprintf("/create/v1/sketches/%s", param0) } -// EditSketches Modifies the sketch identified by the :id param. +// EditSketches modifies the sketch identified by the :id param. // If a file has a valid data field, it will be modified too. func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) { req, err := c.NewEditSketchesRequest(ctx, path, payload, authorization) @@ -128,7 +128,7 @@ func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch, return c.Client.Do(ctx, req) } -// NewEditSketchesRequest create the request corresponding to the edit action endpoint of the sketches resource. +// NewEditSketchesRequest creates the request corresponding to the edit action endpoint of the sketches resource. func (c *Client) NewEditSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) { var body bytes.Buffer err := c.Encoder.Encode(payload, &body, "*/*") @@ -162,7 +162,7 @@ func SearchSketchesPath() string { return fmt.Sprintf("/create/v1/sketches") } -// SearchSketches Provides a paginated list of sketches filtered according to the params. The page size is 100 items. +// SearchSketches provides a paginated list of sketches filtered according to the params. The page size is 100 items. func (c *Client) SearchSketches(ctx context.Context, path string, offset *string, owner *string, authorization *string) (*http.Response, error) { req, err := c.NewSearchSketchesRequest(ctx, path, offset, owner, authorization) if err != nil { @@ -171,7 +171,7 @@ func (c *Client) SearchSketches(ctx context.Context, path string, offset *string return c.Client.Do(ctx, req) } -// NewSearchSketchesRequest create the request corresponding to the search action endpoint of the sketches resource. +// NewSearchSketchesRequest creates the request corresponding to the search action endpoint of the sketches resource. func (c *Client) NewSearchSketchesRequest(ctx context.Context, path string, offset *string, owner *string, authorization *string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { @@ -209,7 +209,7 @@ func ShowSketchesPath(id string) string { return fmt.Sprintf("/create/v1/sketches/%s", param0) } -// ShowSketches Provides the sketch identified by the :id param. +// ShowSketches provides the sketch identified by the :id param. func (c *Client) ShowSketches(ctx context.Context, path string, authorization *string) (*http.Response, error) { req, err := c.NewShowSketchesRequest(ctx, path, authorization) if err != nil { @@ -218,7 +218,7 @@ func (c *Client) ShowSketches(ctx context.Context, path string, authorization *s return c.Client.Do(ctx, req) } -// NewShowSketchesRequest create the request corresponding to the show action endpoint of the sketches resource. +// NewShowSketchesRequest creates the request corresponding to the show action endpoint of the sketches resource. func (c *Client) NewShowSketchesRequest(ctx context.Context, path string, authorization *string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { diff --git a/create_client_helpers/user_types.go b/create_client_helpers/user_types.go index de99a43fff1..2dc74f54e9d 100644 --- a/create_client_helpers/user_types.go +++ b/create_client_helpers/user_types.go @@ -54,7 +54,7 @@ type Sketch struct { Types []string `form:"types,omitempty" json:"types,omitempty" xml:"types,omitempty"` } -//ConvertFrom converts from a local sketch to an Arduino Create sketch. +// ConvertFrom converts from a local sketch to an Arduino Create sketch. func ConvertFrom(sketch sketches.Sketch) *Sketch { _, inoPath := filepath.Split(sketch.Ino.Path) content, err := ioutil.ReadFile(filepath.Join(sketch.FullPath, inoPath))