diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f1c4671ed6ee922d2798e379fd694921b5844d9a..7338093a98d4e17e98a351f3ab9f50853ebf18fa 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,7 +8,7 @@ Reproducible examples are key to finding and fixing bugs. ## Pull requests -Good issues for first time contributors are marked as such. Please feel free to +Good issues for first time contributors are marked as such. Feel free to reach out for clarification on what needs to be done. Split up large changes into several small descriptive commits. @@ -39,7 +39,7 @@ You can run CI locally. The various steps are located in [ci/\*.sh](../ci). 1. [test.sh](../ci/test.sh) 1. [run.sh](../ci/run.sh) which runs the above scripts in order. -For coverage details locally, please see `ci/out/coverage.html` after running [test.sh](../ci/test.sh). +For coverage details locally, see `ci/out/coverage.html` after running [test.sh](../ci/test.sh). See [ci/image/Dockerfile](../ci/image/Dockerfile) for the installation of the CI dependencies on Ubuntu. diff --git a/README.md b/README.md index a16cf2edbb3ffe3e5984433e27ef7f3da50960ea..f799b070116bdb47baef2436b1372640dd7fcccf 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ go get nhooyr.io/websocket For a production quality example that shows off the full API, see the [echo example on the godoc](https://godoc.org/nhooyr.io/websocket#example-package--Echo). On github, the example is at [example_echo_test.go](./example_echo_test.go). -Please use the [errors.As](https://golang.org/pkg/errors/#As) function [new in Go 1.13](https://golang.org/doc/go1.13#error_wrapping) to check for [websocket.CloseError](https://godoc.org/nhooyr.io/websocket#CloseError). See the [CloseError godoc example](https://godoc.org/nhooyr.io/websocket#example-CloseError). +Use the [errors.As](https://golang.org/pkg/errors/#As) function [new in Go 1.13](https://golang.org/doc/go1.13#error_wrapping) to check for [websocket.CloseError](https://godoc.org/nhooyr.io/websocket#CloseError). See the [CloseError godoc example](https://godoc.org/nhooyr.io/websocket#example-CloseError). ### Server @@ -165,11 +165,11 @@ as performant but much easier to use correctly and idiomatic. ## Contributing -Please see [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md). +See [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md). ## Users -If your company or project is using this library, please feel free to open an issue or PR to amend this list. +If your company or project is using this library, feel free to open an issue or PR to amend this list. - [Coder](https://github.com/cdr) - [Tatsu Works](https://github.com/tatsuworks) - Ingresses 20 TB in websocket data every month on their Discord bot. diff --git a/accept.go b/accept.go index 7ef72ad2045502b9ffc0e6cc75ecddffeaf00809..11611d81564cbc2dea90ae3b811b5025feb8ee47 100644 --- a/accept.go +++ b/accept.go @@ -34,7 +34,7 @@ type AcceptOptions struct { // // The only time you need this is if your javascript is running on a different domain // than your WebSocket server. - // Please think carefully about whether you really need this option before you use it. + // Think carefully about whether you really need this option before you use it. // If you do, remember that if you store secure data in cookies, you wil need to verify the // Origin header yourself otherwise you are exposing yourself to a CSRF attack. InsecureSkipVerify bool diff --git a/ci/fmt.sh b/ci/fmt.sh index 4eda00fceb909368463a5f0f1f1d2d8ac1f68b4f..697c37e0e468b51f78303d6c2caedb63c0a37d73 100755 --- a/ci/fmt.sh +++ b/ci/fmt.sh @@ -35,7 +35,7 @@ check() { if [[ ${CI:-} && $(unstaged_files) != "" ]]; then echo echo "Files need generation or are formatted incorrectly." - echo "Please run:" + echo "Run:" echo "./ci/fmt.sh" echo git status diff --git a/dial.go b/dial.go index 2ed836bd4422156ae0fb20ec626c36335338cb75..51d2af807b5775d7bfbdf32b461eb60dfdc49b9f 100644 --- a/dial.go +++ b/dial.go @@ -61,7 +61,7 @@ func dial(ctx context.Context, u string, opts *DialOptions) (_ *Conn, _ *http.Re opts.HTTPClient = http.DefaultClient } if opts.HTTPClient.Timeout > 0 { - return nil, nil, fmt.Errorf("please use context for cancellation instead of http.Client.Timeout; see https://github.com/nhooyr/websocket/issues/67") + return nil, nil, fmt.Errorf("use context for cancellation instead of http.Client.Timeout; see https://github.com/nhooyr/websocket/issues/67") } if opts.HTTPHeader == nil { opts.HTTPHeader = http.Header{} diff --git a/doc.go b/doc.go index d715a052487870f72873764183186eb1b375ca8c..189952571860dae98e415388c2fb08ea729210ec 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // Package websocket is a minimal and idiomatic implementation of the WebSocket protocol. // -// See https://tools.ietf.org/html/rfc6455 +// https://tools.ietf.org/html/rfc6455 // // Conn, Dial, and Accept are the main entrypoints into this package. Use Dial to dial // a WebSocket server, Accept to accept a WebSocket client dial and then Conn to interact @@ -10,8 +10,9 @@ // // The wsjson and wspb subpackages contain helpers for JSON and ProtoBuf messages. // -// Please see https://nhooyr.io/websocket for more overview docs and a +// See https://nhooyr.io/websocket for more overview docs and a // comparison with existing implementations. // -// Please be sure to use the https://golang.org/x/xerrors package when inspecting returned errors. +// Use the errors.As function new in Go 1.13 to check for websocket.CloseError. +// See the CloseError example. package websocket // import "nhooyr.io/websocket" diff --git a/websocket.go b/websocket.go index 56aca7051712d0fb330a7a33a432ab4fcc2ab00b..9976d0fafebf80beebbb17db2516685181ec9acb 100644 --- a/websocket.go +++ b/websocket.go @@ -24,7 +24,7 @@ import ( // You must always read from the connection. Otherwise control // frames will not be handled. See the docs on Reader and CloseRead. // -// Please be sure to call Close on the connection when you +// Be sure to call Close on the connection when you // are finished with it to release the associated resources. // // Every error from Read or Reader will cause the connection diff --git a/websocket_autobahn_python_test.go b/websocket_autobahn_python_test.go index ae7e3022de2a6e738a3d7e22dd3cd118c8b132e7..a1e5cccbd6af600652a8c03836de458cabcbfce7 100644 --- a/websocket_autobahn_python_test.go +++ b/websocket_autobahn_python_test.go @@ -234,7 +234,7 @@ func checkWSTestIndex(t *testing.T, path string) { if failed { path = strings.Replace(path, ".json", ".html", 1) if os.Getenv("CI") == "" { - t.Errorf("wstest found failure, please see %q (output as an artifact in CI)", path) + t.Errorf("wstest found failure, see %q (output as an artifact in CI)", path) } } }