@@ -17,10 +17,10 @@ package sketch
1717
1818import (
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
3838func 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
5757func 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