Skip to content

Commit 00ca8fe

Browse files
committed
Ensure CI is satisfied
1 parent 5dfbefb commit 00ca8fe

16 files changed

+100
-32
lines changed

.github/fmt/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gen() {
88
go list ./... > /dev/null
99
go mod tidy
1010

11-
go install github.com/golang/protobuf/protoc-gen-go
11+
go install golang.org/x/tools/cmd/stringer
1212
go generate ./...
1313
}
1414

.github/main.workflow

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
workflow "main" {
22
on = "push"
3-
resolves = ["fmt", "test"]
3+
resolves = ["fmt", "lint", "test"]
4+
}
5+
6+
action "lint" {
7+
uses = "./.github/lint"
48
}
59

610
action "fmt" {

dataframe_string.go

Lines changed: 0 additions & 17 deletions
This file was deleted.

dataframe.go renamed to datatype.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
//go:generate stringer -type=DataType
99
type DataType int
1010

11+
// DataType constants.
1112
const (
1213
Text DataType = DataType(wscore.OpText)
1314
Binary DataType = DataType(wscore.OpBinary)

datatype_string.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"time"
99

1010
"golang.org/x/time/rate"
11+
1112
"nhooyr.io/ws"
1213
"nhooyr.io/ws/wsjson"
1314
)
1415

15-
func ExampleEcho() {
16+
func ExampleAccept_echo() {
1617
fn := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1718
c, err := ws.Accept(w, r,
1819
ws.AcceptSubprotocols("echo"),
@@ -85,7 +86,7 @@ func ExampleAccept() {
8586
type myJsonStruct struct {
8687
MyField string `json:"my_field"`
8788
}
88-
err = wsjson.Write(c, myJsonStruct{
89+
err = wsjson.Write(r.Context(), c, myJsonStruct{
8990
MyField: "foo",
9091
})
9192
if err != nil {
@@ -118,7 +119,7 @@ func ExampleDial() {
118119
type myJsonStruct struct {
119120
MyField string `json:"my_field"`
120121
}
121-
err = wsjson.Write(c, myJsonStruct{
122+
err = wsjson.Write(ctx, c, myJsonStruct{
122123
MyField: "foo",
123124
})
124125
if err != nil {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require (
66
github.com/golang/protobuf v1.3.1
77
github.com/kr/pretty v0.1.0 // indirect
88
go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16
9-
golang.org/x/net v0.0.0-20190311183353-d8887717615a
10-
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
11-
golang.org/x/tools v0.0.0-20190315191501-e6df0c1bb376
9+
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
10+
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
11+
golang.org/x/tools v0.0.0-20190329215204-73054e8977d1
1212
mvdan.cc/sh v2.6.4+incompatible
1313
)

go.sum

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
88
go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16 h1:3gGa1bM0nG7Ruhu5b7wKnoOOwAD/fJ8iyyAcpOzDG3A=
99
go.coder.com/go-tools v0.0.0-20190317003359-0c6a35b74a16/go.mod h1:iKV5yK9t+J5nG9O3uF6KYdPEz3dyfMyB15MN1rbQ8Qw=
1010
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
11+
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
12+
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
1113
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
1214
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
1315
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
1416
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
1517
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
1618
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
1719
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
18-
golang.org/x/tools v0.0.0-20190315191501-e6df0c1bb376 h1:GfNg/J4IAJguoN+DWPTZ54ElycoBxtQkpxhrbA5edVA=
19-
golang.org/x/tools v0.0.0-20190315191501-e6df0c1bb376/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
20+
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
21+
golang.org/x/tools v0.0.0-20190329215204-73054e8977d1 h1:rLRH2E2wN5JjGJSVlBe1ioUkCKgb6eoL9X8bDmtEpsk=
22+
golang.org/x/tools v0.0.0-20190329215204-73054e8977d1/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
2023
mvdan.cc/sh v2.6.4+incompatible h1:eD6tDeh0pw+/TOTI1BBEryZ02rD2nMcFsgcvde7jffM=
2124
mvdan.cc/sh v2.6.4+incompatible/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8=

statuscode_string.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package tools
55
// See https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md
66
import (
77
_ "go.coder.com/go-tools/cmd/goimports"
8+
_ "golang.org/x/lint/golint"
89
_ "golang.org/x/tools/cmd/stringer"
910
_ "mvdan.cc/sh/cmd/shfmt"
1011
)

ws.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ws
22

33
import (
44
"context"
5+
"net"
56
)
67

78
const (
@@ -18,6 +19,11 @@ func (c *Conn) Subprotocol() string {
1819
panic("TODO")
1920
}
2021

22+
// NetConn returns the net.Conn underlying the Conn.
23+
func (c *Conn) NetConn() net.Conn {
24+
panic("TODO")
25+
}
26+
2127
// MessageWriter returns a writer bounded by the context that will write
2228
// a WebSocket data frame of type dataType to the connection.
2329
// Ensure you close the MessageWriter once you have written to entire message.

wscore/header.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ type Header struct {
1919
MaskKey [4]byte
2020
}
2121

22+
// Bytes returns the bytes of the header.
2223
func (h Header) Bytes() []byte {
2324
panic("TODO")
2425
}
2526

26-
func ReaderHeader(r io.Reader) []byte {
27+
// ReadHeader reads a header from the reader.
28+
func ReadHeader(r io.Reader) []byte {
2729
panic("TODO")
2830
}

wscore/opcode.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package wscore
44
//go:generate stringer -type=Opcode
55
type Opcode int
66

7+
// Opcode constants.
78
const (
89
OpContinuation Opcode = iota
910
OpText

wscore/opcode_string.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wsjson/wsjon.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package wsjson
22

33
import (
4+
"context"
5+
46
"nhooyr.io/ws"
57
)
68

7-
func Read(c *ws.Conn, v interface{}) error {
9+
// Read reads a json message from c into v.
10+
func Read(ctx context.Context, c *ws.Conn, v interface{}) error {
811
panic("TODO")
912
}
1013

11-
func Write(c *ws.Conn, v interface{}) error {
14+
// Write writes the json message v into c.
15+
func Write(ctx context.Context, c *ws.Conn, v interface{}) error {
1216
panic("TODO")
1317
}

wspb/wspb.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package wspb
22

33
import (
4+
"context"
5+
46
"github.com/golang/protobuf/proto"
57

68
"nhooyr.io/ws"
79
)
810

9-
func Read(c *ws.Conn, v proto.Message) error {
11+
// Read reads a protobuf message from c into v.
12+
func Read(ctx context.Context, c *ws.Conn, v proto.Message) error {
1013
panic("TODO")
1114
}
1215

13-
func Write(c *ws.Conn, v proto.Message) error {
16+
// Write writes the protobuf message into c.
17+
func Write(ctx context.Context, c *ws.Conn, v proto.Message) error {
1418
panic("TODO")
1519
}

0 commit comments

Comments
 (0)