summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--endpoint_index.go5
-rw-r--r--errors.go2
-rw-r--r--ws_connection.go14
-rw-r--r--wsmsg_choose.go2
-rw-r--r--wsmsg_confirm.go2
-rw-r--r--wsmsg_hello.go2
-rw-r--r--wsmsg_unchoose.go2
7 files changed, 16 insertions, 13 deletions
diff --git a/endpoint_index.go b/endpoint_index.go
index e5c35ca..dc81275 100644
--- a/endpoint_index.go
+++ b/endpoint_index.go
@@ -152,7 +152,10 @@ func handleIndex(w http.ResponseWriter, req *http.Request) {
username,
department,
&_groups,
- struct{Sport int; NonSport int}{sportRequired, nonSportRequired},
+ struct {
+ Sport int
+ NonSport int
+ }{sportRequired, nonSportRequired},
},
)
if err != nil {
diff --git a/errors.go b/errors.go
index 5b39e4d..257c935 100644
--- a/errors.go
+++ b/errors.go
@@ -42,7 +42,7 @@ var (
errUnexpectedDBError = errors.New("unexpected database error")
errCannotSend = errors.New("cannot send")
errCannotGenerateRandomString = errors.New("cannot generate random string")
- errContextCancelled = errors.New("context cancelled")
+ errContextCanceled = errors.New("context canceled")
errCannotReceiveMessage = errors.New("cannot receive message")
errNoSuchCourse = errors.New("no such course")
errInvalidState = errors.New("invalid state")
diff --git a/ws_connection.go b/ws_connection.go
index 7a0649b..068b6db 100644
--- a/ws_connection.go
+++ b/ws_connection.go
@@ -74,7 +74,7 @@ func handleConn(
cancelPool.CompareAndDelete(userID, &newCancel)
if errors.Is(retErr, context.Canceled) {
/*
- * Only works if it's newCtx that has been cancelled
+ * Only works if it's newCtx that has been canceled
* rather than the original ctx, which is kinda what
* we intend
*/
@@ -172,7 +172,7 @@ func handleConn(
* gets closed, which makes it impossible for us to
* write the context expiry message to the client.
* So we pass the original connection context, which
- * would get cancelled anyway once we close the
+ * would get canceled anyway once we close the
* connection.
* See: https://github.com/coder/websocket/issues/242
* We still need to take care of this while sending so
@@ -212,7 +212,7 @@ func handleConn(
}
select {
case <-newCtx.Done():
- _ = writeText(ctx, c, "E :Context cancelled")
+ _ = writeText(ctx, c, "E :Context canceled")
/* Not a typo to use ctx here */
return
case recv <- &errbytesT{err: nil, bytes: &b}:
@@ -232,14 +232,14 @@ func handleConn(
* processing a select cycle.
*/
return wrapError(
- errContextCancelled,
+ errContextCanceled,
newCtx.Err(),
)
case sendText := <-send:
select {
case <-newCtx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
newCtx.Err(),
)
default:
@@ -253,7 +253,7 @@ func handleConn(
select {
case <-newCtx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
newCtx.Err(),
)
default:
@@ -271,7 +271,7 @@ func handleConn(
select {
case <-newCtx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
newCtx.Err(),
)
default:
diff --git a/wsmsg_choose.go b/wsmsg_choose.go
index 79fee35..0705690 100644
--- a/wsmsg_choose.go
+++ b/wsmsg_choose.go
@@ -56,7 +56,7 @@ func messageChooseCourse(
select {
case <-ctx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
ctx.Err(),
)
default:
diff --git a/wsmsg_confirm.go b/wsmsg_confirm.go
index f20aa2f..8ae51a6 100644
--- a/wsmsg_confirm.go
+++ b/wsmsg_confirm.go
@@ -41,7 +41,7 @@ func messageConfirm(
select {
case <-ctx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
ctx.Err(),
)
default:
diff --git a/wsmsg_hello.go b/wsmsg_hello.go
index f7a984c..8ed03d8 100644
--- a/wsmsg_hello.go
+++ b/wsmsg_hello.go
@@ -41,7 +41,7 @@ func messageHello(
select {
case <-ctx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
ctx.Err(),
)
default:
diff --git a/wsmsg_unchoose.go b/wsmsg_unchoose.go
index 6e85bab..ea1fa1f 100644
--- a/wsmsg_unchoose.go
+++ b/wsmsg_unchoose.go
@@ -51,7 +51,7 @@ func messageUnchooseCourse(
select {
case <-ctx.Done():
return wrapError(
- errContextCancelled,
+ errContextCanceled,
ctx.Err(),
)
default: