Skip to content

Commit 5d2bff0

Browse files
committed
Cleanup for release
1 parent 1d9fe35 commit 5d2bff0

File tree

6 files changed

+8
-24
lines changed

6 files changed

+8
-24
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,3 @@ $ head -c 100000000 /dev/urandom > /tmp/random; cat /tmp/random | pv | time sh
8989
95.4MiB 0:00:00 [1.73GiB/s] [ <=> ]
9090
sh -c "cat > /dev/null" 0.00s user 0.02s system 32% cpu 0.057 total
9191
```
92-
93-
### Performance Goals
94-
95-
Test command
96-
97-
```shell script
98-
head -c 100000000 /dev/urandom > /tmp/random; cat /tmp/random | pv | time coder sh ammar sh -c "cat > /dev/null"
99-
```
100-
101-
streams at
102-
103-
```shell script
104-
95.4MiB 0:00:08 [10.7MiB/s] [ <=> ]
105-
15.34 real 2.16 user 1.54 sys
106-
```
107-
108-
The same command over wush stdout (which is high performance) streams at 17MB/s.

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func (r remoteProcess) listen(ctx context.Context) {
205205
select {
206206
case exitCode := <-exitCode:
207207
if exitCode != 0 {
208-
r.done <- ExitError{Code: int(exitCode)}
208+
r.done <- ExitError{Code: exitCode}
209209
return
210210
}
211211
r.done <- nil

exec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ func (e ExitError) Error() string {
1919

2020
// Process represents a started command.
2121
type Process interface {
22-
// Pid is populated immediately during a successfull start with the process ID.
22+
// Pid is populated immediately during a successful start with the process ID.
2323
Pid() int
2424
// Stdout returns an io.WriteCloser that will pipe writes to the remote command.
25-
// Closure of stdin sends the correspoding close messsage.
25+
// Closure of stdin sends the corresponding close message.
2626
Stdin() io.WriteCloser
2727
// Stdout returns an io.Reader that is connected to the command's standard output.
2828
Stdout() io.Reader

internal/proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Protocol
22

3-
Each Message is represented as a single WebSocket message. A newline character separates a JSON header from the binary body.
3+
Each message is represented as a single WebSocket message. A newline character separates a JSON header from the binary body.
44

55
Some messages may omit the body.
66

internal/proto/protocol_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func TestWithHeader(t *testing.T) {
3131
for _, tcase := range tests {
3232
b := bytes.NewBuffer(nil)
3333
withheader := WithHeader(b, []byte(tcase.inputheader))
34-
withheader.Write([]byte(tcase.inputbody))
34+
_, err := withheader.Write([]byte(tcase.inputbody))
35+
assert.Success(t, "write to buffer with header", err)
3536

3637
msg, err := ioutil.ReadAll(b)
3738
assert.Success(t, "read buffer", err)

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func Serve(ctx context.Context, c *websocket.Conn, execer Execer) error {
122122
}
123123
}
124124

125-
func sendExitCode(ctx context.Context, exitCode int, conn net.Conn) error {
125+
func sendExitCode(_ context.Context, exitCode int, conn net.Conn) error {
126126
header, err := json.Marshal(proto.ServerExitCodeHeader{
127127
Type: proto.TypeExitCode,
128128
ExitCode: exitCode,
@@ -134,7 +134,7 @@ func sendExitCode(ctx context.Context, exitCode int, conn net.Conn) error {
134134
return err
135135
}
136136

137-
func sendPID(ctx context.Context, pid int, conn net.Conn) error {
137+
func sendPID(_ context.Context, pid int, conn net.Conn) error {
138138
header, err := json.Marshal(proto.ServerPidHeader{Type: proto.TypePid, Pid: pid})
139139
if err != nil {
140140
return err

0 commit comments

Comments
 (0)