Skip to content

Commit a85376f

Browse files
author
rsora
committed
Apply general cosmetics
1 parent 11452d5 commit a85376f

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

cli/daemon/daemon.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
7474
VersionString: globals.VersionInfo.VersionString,
7575
})
7676

77-
// register the monitors service
77+
// Register the monitors service
7878
srv_monitor.RegisterMonitorServer(s, &daemon.MonitorService{})
7979

80-
// register the settings service
80+
// Register the settings service
8181
srv_settings.RegisterSettingsServer(s, &daemon.SettingsService{})
8282

83-
// register the debug session service
83+
// Register the debug session service
8484
srv_debug.RegisterDebugServer(s, &daemon.DebugService{})
8585

8686
if !daemonize {
8787
// When parent process ends terminate also the daemon
8888
go func() {
89-
// stdin is closed when the controlling parent process ends
89+
// Stdin is closed when the controlling parent process ends
9090
_, _ = io.Copy(ioutil.Discard, os.Stdin)
9191
os.Exit(0)
9292
}()
@@ -119,6 +119,6 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
119119
// This message will show up on the stdout of the daemon process so that gRPC clients know it is time to connect.
120120
logrus.Infof("Daemon is listening on TCP port %s...", port)
121121
if err := s.Serve(lis); err != nil {
122-
logrus.Fatalf("failed to serve: %v", err)
122+
logrus.Fatalf("Failed to serve: %v", err)
123123
}
124124
}

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)