Commit 35fb9d31 authored by Eduardo Caceres's avatar Eduardo Caceres Committed by Cristian Maglie

Minor style changes in code documentation

parent f8e52e2e
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
// Tool represents a single Tool, part of a Package. // Tool represents a single Tool, part of a Package.
type Tool struct { type Tool struct {
Name string `json:"name,required"` // The Name of the Tool. 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:"-"` Package *Package `json:"-"`
} }
......
...@@ -38,7 +38,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er ...@@ -38,7 +38,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req) 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) { func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -38,7 +38,7 @@ func (c *Client) ListBoards(ctx context.Context, path string) (*http.Response, e ...@@ -38,7 +38,7 @@ func (c *Client) ListBoards(ctx context.Context, path string) (*http.Response, e
return c.Client.Do(ctx, req) 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) { func (c *Client) NewListBoardsRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -69,7 +69,7 @@ func (c *Client) ShowBoards(ctx context.Context, path string) (*http.Response, e ...@@ -69,7 +69,7 @@ func (c *Client) ShowBoards(ctx context.Context, path string) (*http.Response, e
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowBoardsRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -33,7 +33,7 @@ func ByVidPidBoardsV2Path(vid string, pid string) string { ...@@ -33,7 +33,7 @@ func ByVidPidBoardsV2Path(vid string, pid string) string {
return fmt.Sprintf("/builder/v2/boards/byVidPid/%s/%s", param0, param1) 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) { func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewByVidPidBoardsV2Request(ctx, path) req, err := c.NewByVidPidBoardsV2Request(ctx, path)
if err != nil { if err != nil {
...@@ -42,7 +42,7 @@ func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Respo ...@@ -42,7 +42,7 @@ func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Respo
return c.Client.Do(ctx, req) 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) { func (c *Client) NewByVidPidBoardsV2Request(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -62,7 +62,7 @@ func ListBoardsV2Path() string { ...@@ -62,7 +62,7 @@ func ListBoardsV2Path() string {
return fmt.Sprintf("/builder/v2/boards") 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) { func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offset *int) (*http.Response, error) {
req, err := c.NewListBoardsV2Request(ctx, path, limit, offset) req, err := c.NewListBoardsV2Request(ctx, path, limit, offset)
if err != nil { if err != nil {
...@@ -71,7 +71,7 @@ func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offs ...@@ -71,7 +71,7 @@ func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offs
return c.Client.Do(ctx, req) 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) { func (c *Client) NewListBoardsV2Request(ctx context.Context, path string, limit *int, offset *int) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -102,7 +102,7 @@ func ShowBoardsV2Path(fqbn string) string { ...@@ -102,7 +102,7 @@ func ShowBoardsV2Path(fqbn string) string {
return fmt.Sprintf("/builder/v2/boards/%s", param0) 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) { func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowBoardsV2Request(ctx, path) req, err := c.NewShowBoardsV2Request(ctx, path)
if err != nil { if err != nil {
...@@ -111,7 +111,7 @@ func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response, ...@@ -111,7 +111,7 @@ func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response,
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowBoardsV2Request(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -42,7 +42,7 @@ func (c *Client) StartCompilations(ctx context.Context, path string, payload *Co ...@@ -42,7 +42,7 @@ func (c *Client) StartCompilations(ctx context.Context, path string, payload *Co
return c.Client.Do(ctx, req) 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) { func (c *Client) NewStartCompilationsRequest(ctx context.Context, path string, payload *Compilation) (*http.Request, error) {
var body bytes.Buffer var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*") err := c.Encoder.Encode(payload, &body, "*/*")
......
...@@ -38,7 +38,7 @@ func (c *Client) ListExamples(ctx context.Context, path string, maintainer *stri ...@@ -38,7 +38,7 @@ func (c *Client) ListExamples(ctx context.Context, path string, maintainer *stri
return c.Client.Do(ctx, req) 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) { func (c *Client) NewListExamplesRequest(ctx context.Context, path string, maintainer *string, libType *string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -38,7 +38,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er ...@@ -38,7 +38,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -42,7 +42,7 @@ func (c *Client) ListLibraries( ...@@ -42,7 +42,7 @@ func (c *Client) ListLibraries(
return c.Client.Do(ctx, req) 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) { func (c *Client) NewListLibrariesRequest(ctx context.Context, path string, maintainer *string, libType *string, withoutType *string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -73,7 +73,7 @@ func ShowLibrariesPath(id string) string { ...@@ -73,7 +73,7 @@ func ShowLibrariesPath(id string) string {
} }
// ShowLibraries provides the library identified by the :id and :pid param. Doesn't require authentication. // 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) { func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowLibrariesRequest(ctx, path) req, err := c.NewShowLibrariesRequest(ctx, path)
if err != nil { if err != nil {
...@@ -82,7 +82,7 @@ func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response ...@@ -82,7 +82,7 @@ func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -31,7 +31,7 @@ func AddPinnedLibrariesPath(id string) string { ...@@ -31,7 +31,7 @@ func AddPinnedLibrariesPath(id string) string {
return fmt.Sprintf("/builder/pinned/%s", param0) 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) { func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewAddPinnedLibrariesRequest(ctx, path) req, err := c.NewAddPinnedLibrariesRequest(ctx, path)
if err != nil { if err != nil {
...@@ -40,7 +40,7 @@ func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Res ...@@ -40,7 +40,7 @@ func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Res
return c.Client.Do(ctx, req) return c.Client.Do(ctx, req)
} }
// NewAddPinnedLibrariesRequest create the request // NewAddPinnedLibrariesRequest creates the request
// corresponding to the add action endpoint of the pinnedLibraries resource. // corresponding to the add action endpoint of the pinnedLibraries resource.
func (c *Client) NewAddPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) { func (c *Client) NewAddPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
...@@ -63,7 +63,7 @@ func ListPinnedLibrariesPath() string { ...@@ -63,7 +63,7 @@ func ListPinnedLibrariesPath() string {
return fmt.Sprintf("/builder/pinned") 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) { func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewListPinnedLibrariesRequest(ctx, path) req, err := c.NewListPinnedLibrariesRequest(ctx, path)
if err != nil { if err != nil {
...@@ -72,7 +72,7 @@ func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Re ...@@ -72,7 +72,7 @@ func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Re
return c.Client.Do(ctx, req) 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) { func (c *Client) NewListPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -96,7 +96,7 @@ func RemovePinnedLibrariesPath(id string) string { ...@@ -96,7 +96,7 @@ func RemovePinnedLibrariesPath(id string) string {
return fmt.Sprintf("/builder/pinned/%s", param0) 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) { func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewRemovePinnedLibrariesRequest(ctx, path) req, err := c.NewRemovePinnedLibrariesRequest(ctx, path)
if err != nil { if err != nil {
...@@ -105,7 +105,7 @@ func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http. ...@@ -105,7 +105,7 @@ func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http.
return c.Client.Do(ctx, req) 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) { func (c *Client) NewRemovePinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -105,7 +105,7 @@ func InitPackageManager() *packagemanager.PackageManager { ...@@ -105,7 +105,7 @@ func InitPackageManager() *packagemanager.PackageManager {
return pm 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 { func InitLibraryManager(pm *packagemanager.PackageManager) *librariesmanager.LibrariesManager {
logrus.Info("Starting libraries manager") logrus.Info("Starting libraries manager")
lm := librariesmanager.NewLibraryManager( lm := librariesmanager.NewLibraryManager(
......
...@@ -65,7 +65,7 @@ func generateBashCompletions(cmd *cobra.Command, args []string) { ...@@ -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) { func generateManPages(cmd *cobra.Command, args []string) {
if outputDir == "" { if outputDir == "" {
outputDir = "docs/manpages" outputDir = "docs/manpages"
......
...@@ -27,11 +27,11 @@ var test TestType{ ...@@ -27,11 +27,11 @@ var test TestType{
var testString = a.Format(test) var testString = a.Format(test)
fmt.Println(testString) // Prints test.String() fmt.Println(testString) // Prints test.String()
a.Print(test) //does the same. a.Print(test) // Does the same.
testString = b.Format(test) testString = b.Format(test)
fmt.Println(testString) // Prints { field1 : "test", field2 : "42" } fmt.Println(testString) // Prints { field1 : "test", field2 : "42" }
b.Print(test) //Does the same b.Print(test) // Does the same
---- ----
=== The default formatter === The default formatter
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"strings" "strings"
) )
//ProcessResult contains info about a completed process. // ProcessResult contains info about a completed process.
type ProcessResult struct { type ProcessResult struct {
ItemName string `json:"name,required"` ItemName string `json:"name,required"`
Status string `json:"status,omitempty"` Status string `json:"status,omitempty"`
......
...@@ -30,7 +30,7 @@ func PingAlivePath() string { ...@@ -30,7 +30,7 @@ func PingAlivePath() string {
return fmt.Sprintf("/create/alive") 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) { func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewPingAliveRequest(ctx, path) req, err := c.NewPingAliveRequest(ctx, path)
if err != nil { if err != nil {
...@@ -39,7 +39,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er ...@@ -39,7 +39,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req) 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) { func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -33,7 +33,7 @@ func ShowFilesPath(fileType string, id string, name string) string { ...@@ -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) 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) { func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowFilesRequest(ctx, path) req, err := c.NewShowFilesRequest(ctx, path)
if err != nil { if err != nil {
...@@ -42,7 +42,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er ...@@ -42,7 +42,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -36,7 +36,7 @@ const ( ...@@ -36,7 +36,7 @@ const (
prod = true 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) { func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) {
req, err := c.NewCreateSketchesRequest(ctx, path, payload, authorization) req, err := c.NewCreateSketchesRequest(ctx, path, payload, authorization)
if err != nil { if err != nil {
...@@ -45,7 +45,7 @@ func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketc ...@@ -45,7 +45,7 @@ func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketc
return c.Client.Do(ctx, req) 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) { func (c *Client) NewCreateSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) {
var body bytes.Buffer var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*") err := c.Encoder.Encode(payload, &body, "*/*")
...@@ -79,7 +79,7 @@ func DeleteSketchesPath(id string) string { ...@@ -79,7 +79,7 @@ func DeleteSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", id) 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) { func (c *Client) DeleteSketches(ctx context.Context, path string, authorization string) (*http.Response, error) {
req, err := c.NewDeleteSketchesRequest(ctx, path, authorization) req, err := c.NewDeleteSketchesRequest(ctx, path, authorization)
if err != nil { if err != nil {
...@@ -88,7 +88,7 @@ func (c *Client) DeleteSketches(ctx context.Context, path string, authorization ...@@ -88,7 +88,7 @@ func (c *Client) DeleteSketches(ctx context.Context, path string, authorization
return c.Client.Do(ctx, req) 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) { func (c *Client) NewDeleteSketchesRequest(ctx context.Context, path string, authorization string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -118,7 +118,7 @@ func EditSketchesPath(id string) string { ...@@ -118,7 +118,7 @@ func EditSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", param0) 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. // 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) { func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) {
req, err := c.NewEditSketchesRequest(ctx, path, payload, authorization) req, err := c.NewEditSketchesRequest(ctx, path, payload, authorization)
...@@ -128,7 +128,7 @@ func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch, ...@@ -128,7 +128,7 @@ func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch,
return c.Client.Do(ctx, req) 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) { func (c *Client) NewEditSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) {
var body bytes.Buffer var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*") err := c.Encoder.Encode(payload, &body, "*/*")
...@@ -162,7 +162,7 @@ func SearchSketchesPath() string { ...@@ -162,7 +162,7 @@ func SearchSketchesPath() string {
return fmt.Sprintf("/create/v1/sketches") 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) { 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) req, err := c.NewSearchSketchesRequest(ctx, path, offset, owner, authorization)
if err != nil { if err != nil {
...@@ -171,7 +171,7 @@ func (c *Client) SearchSketches(ctx context.Context, path string, offset *string ...@@ -171,7 +171,7 @@ func (c *Client) SearchSketches(ctx context.Context, path string, offset *string
return c.Client.Do(ctx, req) 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) { func (c *Client) NewSearchSketchesRequest(ctx context.Context, path string, offset *string, owner *string, authorization *string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
...@@ -209,7 +209,7 @@ func ShowSketchesPath(id string) string { ...@@ -209,7 +209,7 @@ func ShowSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", param0) 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) { func (c *Client) ShowSketches(ctx context.Context, path string, authorization *string) (*http.Response, error) {
req, err := c.NewShowSketchesRequest(ctx, path, authorization) req, err := c.NewShowSketchesRequest(ctx, path, authorization)
if err != nil { if err != nil {
...@@ -218,7 +218,7 @@ func (c *Client) ShowSketches(ctx context.Context, path string, authorization *s ...@@ -218,7 +218,7 @@ func (c *Client) ShowSketches(ctx context.Context, path string, authorization *s
return c.Client.Do(ctx, req) 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) { func (c *Client) NewShowSketchesRequest(ctx context.Context, path string, authorization *string) (*http.Request, error) {
scheme := c.Scheme scheme := c.Scheme
if scheme == "" { if scheme == "" {
......
...@@ -54,7 +54,7 @@ type Sketch struct { ...@@ -54,7 +54,7 @@ type Sketch struct {
Types []string `form:"types,omitempty" json:"types,omitempty" xml:"types,omitempty"` 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 { func ConvertFrom(sketch sketches.Sketch) *Sketch {
_, inoPath := filepath.Split(sketch.Ino.Path) _, inoPath := filepath.Split(sketch.Ino.Path)
content, err := ioutil.ReadFile(filepath.Join(sketch.FullPath, inoPath)) content, err := ioutil.ReadFile(filepath.Join(sketch.FullPath, inoPath))
......
...@@ -112,7 +112,7 @@ func (p *CTagsParser) toPrototypes() []*types.Prototype { ...@@ -112,7 +112,7 @@ func (p *CTagsParser) toPrototypes() []*types.Prototype {
Prototype: tag.Prototype, Prototype: tag.Prototype,
Modifiers: tag.PrototypeModifiers, Modifiers: tag.PrototypeModifiers,
Line: tag.Line, Line: tag.Line,
//Fields: tag, // Fields: tag,
} }
prototypes = append(prototypes, prototype) prototypes = append(prototypes, prototype)
} }
......
...@@ -79,7 +79,7 @@ type Context struct { ...@@ -79,7 +79,7 @@ type Context struct {
ImportedLibraries libraries.List ImportedLibraries libraries.List
LibrariesResolutionResults map[string]LibraryResolutionResult LibrariesResolutionResults map[string]LibraryResolutionResult
IncludeFolders paths.PathList IncludeFolders paths.PathList
//OutputGccMinusM string // OutputGccMinusM string
// C++ Parsing // C++ Parsing
CTagsOutput string CTagsOutput string
......
...@@ -26,7 +26,7 @@ Then start, get data and stop it when you don't need it anymore: ...@@ -26,7 +26,7 @@ Then start, get data and stop it when you don't need it anymore:
[source, go] [source, go]
---- ----
monitor.Start() monitor.Start()
//Get devices connected // Get devices connected
monitor.Stop() monitor.Stop()
---- ----
You can get connected devices (via Serial or Network ports) by using the following functions: You can get connected devices (via Serial or Network ports) by using the following functions:
......
...@@ -71,7 +71,7 @@ type SerialDevice struct { ...@@ -71,7 +71,7 @@ type SerialDevice struct {
SerialNumber string `json:"serial_number"` SerialNumber string `json:"serial_number"`
ProductID string `json:"pid"` ProductID string `json:"pid"`
VendorID string `json:"vid"` VendorID string `json:"vid"`
//Serial *serial.Info `json:"-"` // Serial *serial.Info `json:"-"`
} }
func (d SerialDevice) String() string { func (d SerialDevice) String() string {
...@@ -85,7 +85,7 @@ func (d SerialDevice) String() string { ...@@ -85,7 +85,7 @@ func (d SerialDevice) String() string {
return ret return ret
} }
//SerialDevices is a list of currently connected devices to the computer // SerialDevices is a list of currently connected devices to the computer
type SerialDevices map[string]*SerialDevice type SerialDevices map[string]*SerialDevice
func (sds SerialDevices) String() string { func (sds SerialDevices) String() string {
...@@ -124,7 +124,7 @@ func (d NetworkDevice) String() string { ...@@ -124,7 +124,7 @@ func (d NetworkDevice) String() string {
fmt.Sprintln(" PORT:", d.Port) fmt.Sprintln(" PORT:", d.Port)
} }
//NetworkDevices is a list of currently connected devices to the computer // NetworkDevices is a list of currently connected devices to the computer
type NetworkDevices map[string]*NetworkDevice type NetworkDevices map[string]*NetworkDevice
func (nds NetworkDevices) String() string { func (nds NetworkDevices) String() string {
......
...@@ -88,7 +88,7 @@ func (m *Monitor) addSerial(port *enumerator.PortDetails) { ...@@ -88,7 +88,7 @@ func (m *Monitor) addSerial(port *enumerator.PortDetails) {
SerialNumber: port.SerialNumber, SerialNumber: port.SerialNumber,
ProductID: "0x" + port.PID, ProductID: "0x" + port.PID,
VendorID: "0x" + port.VID, VendorID: "0x" + port.VID,
//Serial: port, // Serial: port,
} }
for port, dev := range m.serial { for port, dev := range m.serial {
if port == device.Port { if port == device.Port {
......
...@@ -19,7 +19,7 @@ func (g *Group) NewGroup(path string) *Group { ...@@ -19,7 +19,7 @@ func (g *Group) NewGroup(path string) *Group {
checkPath(path) checkPath(path)
path = g.path + path path = g.path + path
//Don't want trailing slash as all sub-paths start with slash // Don't want trailing slash as all sub-paths start with slash
if path[len(path)-1] == '/' { if path[len(path)-1] == '/' {
path = path[:len(path)-1] path = path[:len(path)-1]
} }
......
// +build js // +build js
//This part is copied from github.com/satori/go.uuid but some feature uses non gopherjs compliants calls // This part is copied from github.com/satori/go.uuid but some feature uses non gopherjs compliants calls
//Since goa only needs a subset of the features the js copies them in here // Since goa only needs a subset of the features the js copies them in here
package uuid package uuid
......
...@@ -11,7 +11,7 @@ type LRUCache interface { ...@@ -11,7 +11,7 @@ type LRUCache interface {
// updates the "recently used"-ness of the key. #value, isFound // updates the "recently used"-ness of the key. #value, isFound
Get(key interface{}) (value interface{}, ok bool) Get(key interface{}) (value interface{}, ok bool)
// Check if a key exsists in cache without updating the recent-ness. // Checks if a key exists in cache without updating the recent-ness.
Contains(key interface{}) (ok bool) Contains(key interface{}) (ok bool)
// Returns key's value without updating the "recently used"-ness of the key. // Returns key's value without updating the "recently used"-ness of the key.
......
...@@ -510,7 +510,7 @@ func (s *Server) serviceTypeName(resp *dns.Msg, ttl uint32) { ...@@ -510,7 +510,7 @@ func (s *Server) serviceTypeName(resp *dns.Msg, ttl uint32) {
} }
// Perform probing & announcement // Perform probing & announcement
//TODO: implement a proper probing & conflict resolution // TODO: implement a proper probing & conflict resolution
func (s *Server) probe() { func (s *Server) probe() {
q := new(dns.Msg) q := new(dns.Msg)
q.SetQuestion(s.service.ServiceInstanceName(), dns.TypePTR) q.SetQuestion(s.service.ServiceInstanceName(), dns.TypePTR)
......
...@@ -301,9 +301,9 @@ func (logger *Logger) Panicln(args ...interface{}) { ...@@ -301,9 +301,9 @@ func (logger *Logger) Panicln(args ...interface{}) {
} }
} }
//When file is opened with appending mode, it's safe to // When file is opened with appending mode, it's safe to
//write concurrently to a file (within 4k message on Linux). // write concurrently to a file (within 4k message on Linux).
//In these cases user can choose to disable the lock. // In these cases user can choose to disable the lock.
func (logger *Logger) SetNoLock() { func (logger *Logger) SetNoLock() {
logger.mu.Disable() logger.mu.Disable()
} }
......
...@@ -68,7 +68,7 @@ func PFlagFromGoFlag(goflag *goflag.Flag) *Flag { ...@@ -68,7 +68,7 @@ func PFlagFromGoFlag(goflag *goflag.Flag) *Flag {
Usage: goflag.Usage, Usage: goflag.Usage,
Value: wrapFlagValue(goflag.Value), Value: wrapFlagValue(goflag.Value),
// Looks like golang flags don't set DefValue correctly :-( // Looks like golang flags don't set DefValue correctly :-(
//DefValue: goflag.DefValue, // DefValue: goflag.DefValue,
DefValue: goflag.Value.String(), DefValue: goflag.Value.String(),
} }
// Ex: if the golang flag was -v, allow both -v and --v to work // Ex: if the golang flag was -v, allow both -v and --v to work
......
...@@ -92,11 +92,11 @@ func getPortDetails(item *ole.IDispatch, res *PortDetails) error { ...@@ -92,11 +92,11 @@ func getPortDetails(item *ole.IDispatch, res *PortDetails) error {
} }
res.Name = re[0][1] res.Name = re[0][1]
//itemPnPDeviceID, err := item.GetProperty("PnPDeviceID") // itemPnPDeviceID, err := item.GetProperty("PnPDeviceID")
//if err != nil { // if err != nil {
// return err // return err
//} // }
//PnPDeviceID := itemPnPDeviceID.ToString() // PnPDeviceID := itemPnPDeviceID.ToString()
itemDeviceID, err := item.GetProperty("DeviceID") itemDeviceID, err := item.GetProperty("DeviceID")
if err != nil { if err != nil {
......
...@@ -229,7 +229,7 @@ func (pb *ProgressBar) SetWidth(width int) *ProgressBar { ...@@ -229,7 +229,7 @@ func (pb *ProgressBar) SetWidth(width int) *ProgressBar {
// End print // End print
func (pb *ProgressBar) Finish() { func (pb *ProgressBar) Finish() {
//Protect multiple calls // Protect multiple calls
pb.finishOnce.Do(func() { pb.finishOnce.Do(func() {
close(pb.finish) close(pb.finish)
pb.write(atomic.LoadInt64(&pb.Total), atomic.LoadInt64(&pb.current)) pb.write(atomic.LoadInt64(&pb.Total), atomic.LoadInt64(&pb.current))
......
...@@ -362,7 +362,7 @@ message Term { ...@@ -362,7 +362,7 @@ message Term {
APPEND = 29; // ARRAY, DATUM -> ARRAY APPEND = 29; // ARRAY, DATUM -> ARRAY
// Prepend a single element to the end of an array (like `cons`). // Prepend a single element to the end of an array (like `cons`).
PREPEND = 80; // ARRAY, DATUM -> ARRAY PREPEND = 80; // ARRAY, DATUM -> ARRAY
//Remove the elements of one array from another array. // Remove the elements of one array from another array.
DIFFERENCE = 95; // ARRAY, ARRAY -> ARRAY DIFFERENCE = 95; // ARRAY, ARRAY -> ARRAY
// DATUM Set Ops // DATUM Set Ops
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment