From c2e0c41f803b936da8450869dcc3419f2b96342c Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Fri, 9 Aug 2024 13:43:37 -0500 Subject: [PATCH 1/2] Update import path to github.com/coder/websocket This will create easily solved breakage on updates but I figure it's best to pull the band aid off as early as possible --- README.md | 42 +++++++++++++-------------- accept.go | 2 +- accept_test.go | 4 +-- autobahn_test.go | 10 +++---- close.go | 2 +- close_test.go | 2 +- compress_test.go | 4 +-- conn_test.go | 14 ++++----- dial.go | 2 +- dial_test.go | 8 ++--- doc.go | 4 +-- example_test.go | 4 +-- export_test.go | 2 +- frame.go | 2 +- frame_test.go | 2 +- go.mod | 2 +- internal/examples/chat/README.md | 2 +- internal/examples/chat/chat.go | 2 +- internal/examples/chat/chat_test.go | 2 +- internal/examples/chat/index.html | 2 +- internal/examples/echo/README.md | 2 +- internal/examples/echo/server.go | 2 +- internal/examples/echo/server_test.go | 4 +-- internal/examples/go.mod | 6 ++-- internal/test/wstest/echo.go | 6 ++-- internal/test/wstest/pipe.go | 2 +- internal/thirdparty/frame_test.go | 6 ++-- internal/thirdparty/gin_test.go | 10 +++---- internal/thirdparty/go.mod | 6 ++-- internal/xsync/go_test.go | 2 +- mask_test.go | 2 +- read.go | 6 ++-- write.go | 4 +-- ws_js.go | 8 ++--- ws_js_test.go | 6 ++-- wsjson/wsjson.go | 10 +++---- wsjson/wsjson_test.go | 2 +- 37 files changed, 99 insertions(+), 99 deletions(-) diff --git a/README.md b/README.md index d093746d..c3502fa2 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # websocket -[![Go Reference](https://pkg.go.dev/badge/nhooyr.io/websocket.svg)](https://pkg.go.dev/nhooyr.io/websocket) -[![Go Coverage](https://img.shields.io/badge/coverage-91%25-success)](https://nhooyr.io/websocket/coverage.html) +[![Go Reference](https://pkg.go.dev/badge/github.com/coder/websocket.svg)](https://pkg.go.dev/github.com/coder/websocket) +[![Go Coverage](https://img.shields.io/badge/coverage-91%25-success)](https://github.com/coder/websocket/coverage.html) websocket is a minimal and idiomatic WebSocket library for Go. ## Install ```sh -go get nhooyr.io/websocket +go get github.com/coder/websocket ``` ## Highlights @@ -16,16 +16,16 @@ go get nhooyr.io/websocket - Minimal and idiomatic API - First class [context.Context](https://blog.golang.org/context) support - Fully passes the WebSocket [autobahn-testsuite](https://github.com/crossbario/autobahn-testsuite) -- [Zero dependencies](https://pkg.go.dev/nhooyr.io/websocket?tab=imports) -- JSON helpers in the [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) subpackage +- [Zero dependencies](https://pkg.go.dev/github.com/coder/websocket?tab=imports) +- JSON helpers in the [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage - Zero alloc reads and writes - Concurrent writes -- [Close handshake](https://pkg.go.dev/nhooyr.io/websocket#Conn.Close) -- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper -- [Ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API +- [Close handshake](https://pkg.go.dev/github.com/coder/websocket#Conn.Close) +- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper +- [Ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API - [RFC 7692](https://tools.ietf.org/html/rfc7692) permessage-deflate compression -- [CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper for write only connections -- Compile to [Wasm](https://pkg.go.dev/nhooyr.io/websocket#hdr-Wasm) +- [CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections +- Compile to [Wasm](https://pkg.go.dev/github.com/coder/websocket#hdr-Wasm) ## Roadmap @@ -102,14 +102,14 @@ Advantages of [gorilla/websocket](https://github.com/gorilla/websocket): - Mature and widely used - [Prepared writes](https://pkg.go.dev/github.com/gorilla/websocket#PreparedMessage) - Configurable [buffer sizes](https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers) -- No extra goroutine per connection to support cancellation with context.Context. This costs nhooyr.io/websocket 2 KB of memory per connection. +- No extra goroutine per connection to support cancellation with context.Context. This costs github.com/coder/websocket 2 KB of memory per connection. - Will be removed soon with [context.AfterFunc](https://github.com/golang/go/issues/57928). See [#411](https://github.com/nhooyr/websocket/issues/411) -Advantages of nhooyr.io/websocket: +Advantages of github.com/coder/websocket: - Minimal and idiomatic API - - Compare godoc of [nhooyr.io/websocket](https://pkg.go.dev/nhooyr.io/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side. -- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper + - Compare godoc of [github.com/coder/websocket](https://pkg.go.dev/github.com/coder/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side. +- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper - Zero alloc reads and writes ([gorilla/websocket#535](https://github.com/gorilla/websocket/issues/535)) - Full [context.Context](https://blog.golang.org/context) support - Dial uses [net/http.Client](https://golang.org/pkg/net/http/#Client) @@ -117,24 +117,24 @@ Advantages of nhooyr.io/websocket: - Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client. - Concurrent writes - Close handshake ([gorilla/websocket#448](https://github.com/gorilla/websocket/issues/448)) -- Idiomatic [ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API +- Idiomatic [ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API - Gorilla requires registering a pong callback before sending a Ping - Can target Wasm ([gorilla/websocket#432](https://github.com/gorilla/websocket/issues/432)) -- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) subpackage +- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage - [1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go - Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/). Soon we'll have assembly and be 3x faster [#326](https://github.com/nhooyr/websocket/pull/326) - Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support - Gorilla only supports no context takeover mode -- [CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper for write only connections ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) +- [CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) #### golang.org/x/net/websocket [golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated. See [golang/go/issues/18152](https://github.com/golang/go/issues/18152). -The [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) can help in transitioning -to nhooyr.io/websocket. +The [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) can help in transitioning +to github.com/coder/websocket. #### gobwas/ws @@ -143,7 +143,7 @@ in an event driven style for performance. See the author's [blog post](https://m However it is quite bloated. See https://pkg.go.dev/github.com/gobwas/ws -When writing idiomatic Go, nhooyr.io/websocket will be faster and easier to use. +When writing idiomatic Go, github.com/coder/websocket will be faster and easier to use. #### lesismal/nbio @@ -152,4 +152,4 @@ event driven for performance reasons. However it is quite bloated. See https://pkg.go.dev/github.com/lesismal/nbio -When writing idiomatic Go, nhooyr.io/websocket will be faster and easier to use. +When writing idiomatic Go, github.com/coder/websocket will be faster and easier to use. diff --git a/accept.go b/accept.go index 285b3103..f672a730 100644 --- a/accept.go +++ b/accept.go @@ -17,7 +17,7 @@ import ( "path/filepath" "strings" - "nhooyr.io/websocket/internal/errd" + "github.com/coder/websocket/internal/errd" ) // AcceptOptions represents Accept's options. diff --git a/accept_test.go b/accept_test.go index 18233b1e..4f799126 100644 --- a/accept_test.go +++ b/accept_test.go @@ -13,8 +13,8 @@ import ( "sync" "testing" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/xrand" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/xrand" ) func TestAccept(t *testing.T) { diff --git a/autobahn_test.go b/autobahn_test.go index 57ceebd5..b1b3a7e9 100644 --- a/autobahn_test.go +++ b/autobahn_test.go @@ -17,11 +17,11 @@ import ( "testing" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/wstest" - "nhooyr.io/websocket/internal/util" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/wstest" + "github.com/coder/websocket/internal/util" ) var excludedAutobahnCases = []string{ diff --git a/close.go b/close.go index 31504b0e..ff2e878a 100644 --- a/close.go +++ b/close.go @@ -11,7 +11,7 @@ import ( "net" "time" - "nhooyr.io/websocket/internal/errd" + "github.com/coder/websocket/internal/errd" ) // StatusCode represents a WebSocket status code. diff --git a/close_test.go b/close_test.go index 6bf3c256..aec582c1 100644 --- a/close_test.go +++ b/close_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "nhooyr.io/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/assert" ) func TestCloseError(t *testing.T) { diff --git a/compress_test.go b/compress_test.go index 667e1408..d97492cf 100644 --- a/compress_test.go +++ b/compress_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/xrand" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/xrand" ) func Test_slidingWindow(t *testing.T) { diff --git a/conn_test.go b/conn_test.go index 2b44ad22..be7c9983 100644 --- a/conn_test.go +++ b/conn_test.go @@ -16,13 +16,13 @@ import ( "testing" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/wstest" - "nhooyr.io/websocket/internal/test/xrand" - "nhooyr.io/websocket/internal/xsync" - "nhooyr.io/websocket/wsjson" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/wstest" + "github.com/coder/websocket/internal/test/xrand" + "github.com/coder/websocket/internal/xsync" + "github.com/coder/websocket/wsjson" ) func TestConn(t *testing.T) { diff --git a/dial.go b/dial.go index e4c4daa1..ad61a35d 100644 --- a/dial.go +++ b/dial.go @@ -17,7 +17,7 @@ import ( "sync" "time" - "nhooyr.io/websocket/internal/errd" + "github.com/coder/websocket/internal/errd" ) // DialOptions represents Dial's options. diff --git a/dial_test.go b/dial_test.go index 237a2874..f94cd73b 100644 --- a/dial_test.go +++ b/dial_test.go @@ -15,10 +15,10 @@ import ( "testing" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/util" - "nhooyr.io/websocket/internal/xsync" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/util" + "github.com/coder/websocket/internal/xsync" ) func TestBadDials(t *testing.T) { diff --git a/doc.go b/doc.go index 2ab648a6..03edf129 100644 --- a/doc.go +++ b/doc.go @@ -15,7 +15,7 @@ // // The wsjson subpackage contain helpers for JSON and protobuf messages. // -// More documentation at https://nhooyr.io/websocket. +// More documentation at https://github.com/coder/websocket. // // # Wasm // @@ -31,4 +31,4 @@ // - Conn.CloseNow is Close(StatusGoingAway, "") // - HTTPClient, HTTPHeader and CompressionMode in DialOptions are no-op // - *http.Response from Dial is &http.Response{} with a 101 status code on success -package websocket // import "nhooyr.io/websocket" +package websocket // import "github.com/coder/websocket" diff --git a/example_test.go b/example_test.go index 590c0411..4cc0cf11 100644 --- a/example_test.go +++ b/example_test.go @@ -6,8 +6,8 @@ import ( "net/http" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/wsjson" + "github.com/coder/websocket" + "github.com/coder/websocket/wsjson" ) func ExampleAccept() { diff --git a/export_test.go b/export_test.go index a644d8f0..d3443991 100644 --- a/export_test.go +++ b/export_test.go @@ -6,7 +6,7 @@ package websocket import ( "net" - "nhooyr.io/websocket/internal/util" + "github.com/coder/websocket/internal/util" ) func (c *Conn) RecordBytesWritten() *int { diff --git a/frame.go b/frame.go index d5631863..e7ab76be 100644 --- a/frame.go +++ b/frame.go @@ -9,7 +9,7 @@ import ( "io" "math" - "nhooyr.io/websocket/internal/errd" + "github.com/coder/websocket/internal/errd" ) // opcode represents a WebSocket opcode. diff --git a/frame_test.go b/frame_test.go index bd626358..08874cb5 100644 --- a/frame_test.go +++ b/frame_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "nhooyr.io/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/assert" ) func TestHeader(t *testing.T) { diff --git a/go.mod b/go.mod index 715a9f7a..336411a5 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module nhooyr.io/websocket +module github.com/coder/websocket go 1.19 diff --git a/internal/examples/chat/README.md b/internal/examples/chat/README.md index 574c6994..4d354586 100644 --- a/internal/examples/chat/README.md +++ b/internal/examples/chat/README.md @@ -1,6 +1,6 @@ # Chat Example -This directory contains a full stack example of a simple chat webapp using nhooyr.io/websocket. +This directory contains a full stack example of a simple chat webapp using github.com/coder/websocket. ```bash $ cd examples/chat diff --git a/internal/examples/chat/chat.go b/internal/examples/chat/chat.go index 8b1e30c1..3cb1e021 100644 --- a/internal/examples/chat/chat.go +++ b/internal/examples/chat/chat.go @@ -12,7 +12,7 @@ import ( "golang.org/x/time/rate" - "nhooyr.io/websocket" + "github.com/coder/websocket" ) // chatServer enables broadcasting to a set of subscribers. diff --git a/internal/examples/chat/chat_test.go b/internal/examples/chat/chat_test.go index f80f1de1..8eb72051 100644 --- a/internal/examples/chat/chat_test.go +++ b/internal/examples/chat/chat_test.go @@ -14,7 +14,7 @@ import ( "golang.org/x/time/rate" - "nhooyr.io/websocket" + "github.com/coder/websocket" ) func Test_chatServer(t *testing.T) { diff --git a/internal/examples/chat/index.html b/internal/examples/chat/index.html index 64edd286..7038342d 100644 --- a/internal/examples/chat/index.html +++ b/internal/examples/chat/index.html @@ -2,7 +2,7 @@ - nhooyr.io/websocket - Chat Example + github.com/coder/websocket - Chat Example diff --git a/internal/examples/echo/README.md b/internal/examples/echo/README.md index ac03f640..3abbbb57 100644 --- a/internal/examples/echo/README.md +++ b/internal/examples/echo/README.md @@ -1,6 +1,6 @@ # Echo Example -This directory contains a echo server example using nhooyr.io/websocket. +This directory contains a echo server example using github.com/coder/websocket. ```bash $ cd examples/echo diff --git a/internal/examples/echo/server.go b/internal/examples/echo/server.go index 246ad582..a44d20b5 100644 --- a/internal/examples/echo/server.go +++ b/internal/examples/echo/server.go @@ -9,7 +9,7 @@ import ( "golang.org/x/time/rate" - "nhooyr.io/websocket" + "github.com/coder/websocket" ) // echoServer is the WebSocket echo server implementation. diff --git a/internal/examples/echo/server_test.go b/internal/examples/echo/server_test.go index 9b608301..81e8cfc2 100644 --- a/internal/examples/echo/server_test.go +++ b/internal/examples/echo/server_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/wsjson" + "github.com/coder/websocket" + "github.com/coder/websocket/wsjson" ) // Test_echoServer tests the echoServer by sending it 5 different messages diff --git a/internal/examples/go.mod b/internal/examples/go.mod index c98b81ce..4f7a8a70 100644 --- a/internal/examples/go.mod +++ b/internal/examples/go.mod @@ -1,10 +1,10 @@ -module nhooyr.io/websocket/examples +module github.com/coder/websocket/examples go 1.19 -replace nhooyr.io/websocket => ../.. +replace github.com/coder/websocket => ../.. require ( + github.com/coder/websocket v0.0.0-00010101000000-000000000000 golang.org/x/time v0.3.0 - nhooyr.io/websocket v0.0.0-00010101000000-000000000000 ) diff --git a/internal/test/wstest/echo.go b/internal/test/wstest/echo.go index dc21a8f0..c0c8dcd7 100644 --- a/internal/test/wstest/echo.go +++ b/internal/test/wstest/echo.go @@ -7,9 +7,9 @@ import ( "io" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/test/xrand" - "nhooyr.io/websocket/internal/xsync" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/test/xrand" + "github.com/coder/websocket/internal/xsync" ) // EchoLoop echos every msg received from c until an error diff --git a/internal/test/wstest/pipe.go b/internal/test/wstest/pipe.go index 8e1deb47..b8cf094d 100644 --- a/internal/test/wstest/pipe.go +++ b/internal/test/wstest/pipe.go @@ -10,7 +10,7 @@ import ( "net/http" "net/http/httptest" - "nhooyr.io/websocket" + "github.com/coder/websocket" ) // Pipe is used to create an in memory connection diff --git a/internal/thirdparty/frame_test.go b/internal/thirdparty/frame_test.go index 89042e53..75b05291 100644 --- a/internal/thirdparty/frame_test.go +++ b/internal/thirdparty/frame_test.go @@ -11,7 +11,7 @@ import ( _ "github.com/gorilla/websocket" _ "github.com/lesismal/nbio/nbhttp/websocket" - _ "nhooyr.io/websocket" + _ "github.com/coder/websocket" ) func basicMask(b []byte, maskKey [4]byte, pos int) int { @@ -22,10 +22,10 @@ func basicMask(b []byte, maskKey [4]byte, pos int) int { return pos & 3 } -//go:linkname maskGo nhooyr.io/websocket.maskGo +//go:linkname maskGo github.com/coder/websocket.maskGo func maskGo(b []byte, key32 uint32) int -//go:linkname maskAsm nhooyr.io/websocket.maskAsm +//go:linkname maskAsm github.com/coder/websocket.maskAsm func maskAsm(b *byte, len int, key32 uint32) uint32 //go:linkname nbioMaskBytes github.com/lesismal/nbio/nbhttp/websocket.maskXOR diff --git a/internal/thirdparty/gin_test.go b/internal/thirdparty/gin_test.go index 6d59578d..bd30ebdd 100644 --- a/internal/thirdparty/gin_test.go +++ b/internal/thirdparty/gin_test.go @@ -10,11 +10,11 @@ import ( "github.com/gin-gonic/gin" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/wstest" - "nhooyr.io/websocket/wsjson" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/wstest" + "github.com/coder/websocket/wsjson" ) func TestGin(t *testing.T) { diff --git a/internal/thirdparty/go.mod b/internal/thirdparty/go.mod index d991dd64..d946ffae 100644 --- a/internal/thirdparty/go.mod +++ b/internal/thirdparty/go.mod @@ -1,15 +1,15 @@ -module nhooyr.io/websocket/internal/thirdparty +module github.com/coder/websocket/internal/thirdparty go 1.19 -replace nhooyr.io/websocket => ../.. +replace github.com/coder/websocket => ../.. require ( + github.com/coder/websocket v0.0.0-00010101000000-000000000000 github.com/gin-gonic/gin v1.9.1 github.com/gobwas/ws v1.3.0 github.com/gorilla/websocket v1.5.0 github.com/lesismal/nbio v1.3.18 - nhooyr.io/websocket v0.0.0-00010101000000-000000000000 ) require ( diff --git a/internal/xsync/go_test.go b/internal/xsync/go_test.go index dabea8a5..a3f7053b 100644 --- a/internal/xsync/go_test.go +++ b/internal/xsync/go_test.go @@ -3,7 +3,7 @@ package xsync import ( "testing" - "nhooyr.io/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/assert" ) func TestGoRecover(t *testing.T) { diff --git a/mask_test.go b/mask_test.go index 54f55e43..00a9f0a2 100644 --- a/mask_test.go +++ b/mask_test.go @@ -8,7 +8,7 @@ import ( "math/bits" "testing" - "nhooyr.io/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/assert" ) func basicMask(b []byte, key uint32) uint32 { diff --git a/read.go b/read.go index a59e71d9..1b9404b8 100644 --- a/read.go +++ b/read.go @@ -13,9 +13,9 @@ import ( "strings" "time" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/util" - "nhooyr.io/websocket/internal/xsync" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/util" + "github.com/coder/websocket/internal/xsync" ) // Reader reads from the connection until there is a WebSocket diff --git a/write.go b/write.go index d7222f2d..e294a680 100644 --- a/write.go +++ b/write.go @@ -16,8 +16,8 @@ import ( "compress/flate" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/util" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/util" ) // Writer returns a writer bounded by the context that will write diff --git a/ws_js.go b/ws_js.go index 02d61f28..a8de0c63 100644 --- a/ws_js.go +++ b/ws_js.go @@ -1,4 +1,4 @@ -package websocket // import "nhooyr.io/websocket" +package websocket // import "github.com/coder/websocket" import ( "bytes" @@ -14,9 +14,9 @@ import ( "sync" "syscall/js" - "nhooyr.io/websocket/internal/bpool" - "nhooyr.io/websocket/internal/wsjs" - "nhooyr.io/websocket/internal/xsync" + "github.com/coder/websocket/internal/bpool" + "github.com/coder/websocket/internal/wsjs" + "github.com/coder/websocket/internal/xsync" ) // opcode represents a WebSocket opcode. diff --git a/ws_js_test.go b/ws_js_test.go index ba98b9a0..b56ad16b 100644 --- a/ws_js_test.go +++ b/ws_js_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/test/assert" - "nhooyr.io/websocket/internal/test/wstest" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/test/assert" + "github.com/coder/websocket/internal/test/wstest" ) func TestWasm(t *testing.T) { diff --git a/wsjson/wsjson.go b/wsjson/wsjson.go index 7c986a0d..05e7cfa1 100644 --- a/wsjson/wsjson.go +++ b/wsjson/wsjson.go @@ -1,15 +1,15 @@ // Package wsjson provides helpers for reading and writing JSON messages. -package wsjson // import "nhooyr.io/websocket/wsjson" +package wsjson // import "github.com/coder/websocket/wsjson" import ( "context" "encoding/json" "fmt" - "nhooyr.io/websocket" - "nhooyr.io/websocket/internal/bpool" - "nhooyr.io/websocket/internal/errd" - "nhooyr.io/websocket/internal/util" + "github.com/coder/websocket" + "github.com/coder/websocket/internal/bpool" + "github.com/coder/websocket/internal/errd" + "github.com/coder/websocket/internal/util" ) // Read reads a JSON message from c into v. diff --git a/wsjson/wsjson_test.go b/wsjson/wsjson_test.go index 080ab38d..87a72854 100644 --- a/wsjson/wsjson_test.go +++ b/wsjson/wsjson_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "nhooyr.io/websocket/internal/test/xrand" + "github.com/coder/websocket/internal/test/xrand" ) func BenchmarkJSON(b *testing.B) { From 782e5d250b0b078dd77f5500d9d9ed61665a692f Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Fri, 9 Aug 2024 13:50:13 -0500 Subject: [PATCH 2/2] Remove version on lint rule vulncheck was using slices which is only in newer Go versions. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9b4b5f6..13ddbf3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,6 @@ jobs: - uses: actions/checkout@v4 - run: go version - uses: actions/setup-go@v5 - with: - go-version-file: ./go.mod - run: ./ci/lint.sh test: