Skip to content

Commit 920a3e7

Browse files
committed
#1456 - Reformat (fix lint).
1 parent c82ff50 commit 920a3e7

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Diff for: cli/sketch/new.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ package sketch
1717

1818
import (
1919
"os"
20-
20+
2121
"github.com/arduino/arduino-cli/cli/errorcodes"
2222
"github.com/arduino/arduino-cli/cli/feedback"
23-
sk "github.com/arduino/arduino-cli/commands/sketch"
23+
sk "github.com/arduino/arduino-cli/commands/sketch"
2424
"github.com/spf13/cobra"
2525
)
2626

@@ -37,11 +37,11 @@ func initNewCommand() *cobra.Command {
3737
}
3838

3939
func runNewCommand(cmd *cobra.Command, args []string) {
40-
sketchDir, _, err := sk.CreateSketch(args[0]);
41-
if err != nil {
42-
feedback.Errorf("Error creating sketch: %v", err) // TODO: use `tr()`
40+
sketchDir, _, err := sk.CreateSketch(args[0])
41+
if err != nil {
42+
feedback.Errorf("Error creating sketch: %v", err) // TODO: use `tr()`
4343
os.Exit(errorcodes.ErrGeneric)
44-
}
44+
}
4545

4646
feedback.Print(tr("Sketch created in: %s", sketchDir))
4747
}

Diff for: commands/sketch/new.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ package sketch
1717

1818
import (
1919
"context"
20-
"os"
20+
"io/ioutil"
21+
"os"
2122
"path/filepath"
2223
"strings"
23-
"io/ioutil"
2424

2525
"github.com/arduino/arduino-cli/commands"
2626
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
@@ -36,11 +36,11 @@ void loop() {
3636

3737
// CreateSketch creates a new sketch
3838
func CreateSketch(sketchName string) (string, string, error) {
39-
// Trim to avoid issues if user creates a sketch adding the .ino extesion to the name
39+
// Trim to avoid issues if user creates a sketch adding the .ino extesion to the name
4040
trimmedSketchName := strings.TrimSuffix(sketchName, ".ino")
4141
sketchDir, err := filepath.Abs(trimmedSketchName)
4242
if err != nil {
43-
return "", "", err
43+
return "", "", err
4444
}
4545
if err := os.MkdirAll(sketchDir, os.FileMode(0755)); err != nil {
4646
return "", "", err
@@ -50,15 +50,15 @@ func CreateSketch(sketchName string) (string, string, error) {
5050
if err := ioutil.WriteFile(sketchFile, emptySketch, os.FileMode(0644)); err != nil {
5151
return "", "", err
5252
}
53-
return sketchDir, sketchFile, nil
53+
return sketchDir, sketchFile, nil
5454
}
5555

5656
// NewSketch FIXMEDOC
5757
func NewSketch(ctx context.Context, req *rpc.NewSketchRequest) (*rpc.NewSketchResponse, error) {
58-
_, sketchFile, err := CreateSketch(req.SketchName);
59-
if err != nil {
60-
return nil, &commands.CantCreateSketchError{Cause: err}
61-
}
58+
_, sketchFile, err := CreateSketch(req.SketchName)
59+
if err != nil {
60+
return nil, &commands.CantCreateSketchError{Cause: err}
61+
}
6262

6363
return &rpc.NewSketchResponse{MainFile: sketchFile}, nil
6464
}

0 commit comments

Comments
 (0)