Skip to content

Commit af37b6c

Browse files
author
rsora
committed
Apply general cosmetics
1 parent 351d159 commit af37b6c

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

cli/daemon/daemon.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
7070
VersionString: globals.VersionInfo.VersionString,
7171
})
7272

73-
// register the monitors service
73+
// Register the monitors service
7474
srv_monitor.RegisterMonitorServer(s, &daemon.MonitorService{})
7575

76-
// register the settings service
76+
// Register the settings service
7777
srv_settings.RegisterSettingsServer(s, &daemon.SettingsService{})
7878

79-
// register the debug session service
79+
// Register the debug session service
8080
srv_debug.RegisterDebugServer(s, &daemon.DebugService{})
8181

8282
if !daemonize {
8383
// When parent process ends terminate also the daemon
8484
go func() {
85-
// stdin is closed when the controlling parent process ends
85+
// Stdin is closed when the controlling parent process ends
8686
_, _ = io.Copy(ioutil.Discard, os.Stdin)
8787
os.Exit(0)
8888
}()
@@ -91,9 +91,9 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
9191
logrus.Infof("Starting daemon on TCP port %s", port)
9292
lis, err := net.Listen("tcp", fmt.Sprintf(":%s", port))
9393
if err != nil {
94-
logrus.Fatalf("failed to listen: %v", err)
94+
logrus.Fatalf("Failed to listen: %v", err)
9595
}
9696
if err := s.Serve(lis); err != nil {
97-
logrus.Fatalf("failed to serve: %v", err)
97+
logrus.Fatalf("Failed to serve: %v", err)
9898
}
9999
}

client_example/main.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,28 +120,28 @@ func main() {
120120

121121
// Attach a board to a sketch.
122122
// Uncomment if you do have an actual board connected.
123-
//log.Println("calling BoardAttach(serial:///dev/ttyACM0)")
124-
//callBoardAttach(client, instance)
123+
// log.Println("calling BoardAttach(serial:///dev/ttyACM0)")
124+
// callBoardAttach(client, instance)
125125

126126
// Compile a sketch
127127
log.Println("calling Compile(arduino:samd:mkr1000, VERBOSE, hello.ino)")
128128
callCompile(client, instance)
129129

130130
// Upload a sketch
131131
// Uncomment if you do have an actual board connected.
132-
//log.Println("calling Upload(arduino:samd:mkr1000, /dev/ttyACM0, VERBOSE, hello.ino)")
133-
//callUpload(client, instance)
132+
// log.Println("calling Upload(arduino:samd:mkr1000, /dev/ttyACM0, VERBOSE, hello.ino)")
133+
// callUpload(client, instance)
134134

135135
// Debug a sketch on a board
136136
// Uncomment if you do have an actual board connected via debug port,
137137
// or a board connected to a debugger.
138-
//debugClient := dbg.NewDebugClient(conn)
139-
//debugStreamingClient, err := debugClient.Debug(context.Background())
140-
//if err != nil {
141-
// log.Fatalf("debug steraming open error: %s\n", err)
142-
//}
143-
//log.Println("calling Debug(arduino:samd:mkr1000, hello.ino)")
144-
//callDebugger(debugStreamingClient, instance)
138+
// debugClient := dbg.NewDebugClient(conn)
139+
// debugStreamingClient, err := debugClient.Debug(context.Background())
140+
// if err != nil {
141+
// log.Fatalf("debug steraming open error: %s\n", err)
142+
// }
143+
// log.Println("calling Debug(arduino:samd:mkr1000, hello.ino)")
144+
// callDebugger(debugStreamingClient, instance)
145145

146146
// List all boards
147147
log.Println("calling BoardListAll(mkr)")
@@ -833,7 +833,7 @@ func callDebugger(debugStreamingOpenClient dbg.Debug_DebugClient, instance *rpc.
833833
}
834834
// Loop and consume the server stream until all the operations are done.
835835
waitForPrompt(debugStreamingOpenClient, "(gdb)")
836-
// wait for gdb to init and show the prompt
836+
// Wait for gdb to init and show the prompt
837837
log.Printf("Send 'info registers' rcommand")
838838
err = debugStreamingOpenClient.Send(&dbg.DebugReq{Data: []byte("info registers\n")})
839839
if err != nil {

commands/daemon/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *ArduinoCoreServerImpl) Compile(req *rpc.CompileReq, stream rpc.ArduinoC
127127
stream.Context(), req,
128128
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.CompileResp{OutStream: data}) }),
129129
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.CompileResp{ErrStream: data}) }),
130-
false) // set debug to false
130+
false) // Set debug to false
131131
if err != nil {
132132
return err
133133
}

commands/daemon/debug.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package daemon
1717

1818
import (
1919
"fmt"
20+
2021
"github.com/arduino/arduino-cli/arduino/utils"
2122
cmd "github.com/arduino/arduino-cli/commands/debug"
2223
dbg "github.com/arduino/arduino-cli/rpc/debug"
@@ -27,22 +28,22 @@ type DebugService struct{}
2728

2829
// Debug returns a stream response that can be used to fetch data from the
2930
// target. The first message passed through the `Debug` request must
30-
// contain DebugConfigReq configuration params, not data.
31+
// contain DebugReq configuration params, not data.
3132
func (s *DebugService) Debug(stream dbg.Debug_DebugServer) error {
3233

33-
// grab the first message
34+
// Grab the first message
3435
msg, err := stream.Recv()
3536
if err != nil {
3637
return err
3738
}
3839

39-
// ensure it's a config message and not data
40+
// Ensure it's a config message and not data
4041
req := msg.GetDebugReq()
4142
if req == nil {
42-
return fmt.Errorf("first message must contain debug request, not data")
43+
return fmt.Errorf("First message must contain debug request, not data")
4344
}
4445

45-
// launch debug recipe attaching stdin and out to grpc streaming
46+
// Launch debug recipe attaching stdin and out to grpc streaming
4647
resp, err := cmd.Debug(stream.Context(), req,
4748
utils.ConsumeStreamFrom(func() ([]byte, error) {
4849
command, err := stream.Recv()

commands/debug/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
7575
}
7676

7777
go func() {
78-
// copy data from passed inStream into command stdIn
78+
// Copy data from passed inStream into command stdIn
7979
io.Copy(in, inStream)
8080
// In any case, try process termination after a second to avoid leaving
8181
// zombie process.

rpc/debug/debug.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,5 @@ message DebugResp {
5858
string error = 2;
5959
}
6060

61-
// duplicate from commands/common.proto
62-
// as module imports seems not to work
61+
// TODO remove this in next proto refactoring because is a duplicate from commands/common.proto
6362
message Instance { int32 id = 1; }

0 commit comments

Comments
 (0)