From 7f280968675bcc9f310008fc6b8abff0b923734c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 2 May 2023 13:37:05 +0300 Subject: [PATCH] Spelling and grammar fixes (#820) --- CHANGELOG.md | 6 +++--- _examples/graceful/main.go | 2 +- _examples/rest/main.go | 2 +- middleware/compress.go | 4 ++-- middleware/middleware_test.go | 2 +- middleware/throttle_test.go | 2 +- mux.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1feeec0..e6ac3e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,14 +90,14 @@ incremental, with the architecture and api being the same today as it was origin makes chi a pretty easy project to maintain, as well thanks to the many amazing community contributions over the years to who all help make chi better (total of 86 contributors to date -- thanks all!). -Chi has been an labour of love, art and engineering, with the goals to offer beautiful ergonomics, flexibility, performance +Chi has been a labour of love, art and engineering, with the goals to offer beautiful ergonomics, flexibility, performance and simplicity when building HTTP services with Go. I've strived to keep the router very minimal in surface area / code size, and always improving the code wherever possible -- and as of today the `chi` package is just 1082 lines of code (not counting middlewares, which are all optional). As well, I don't have the exact metrics, but from my analysis and email exchanges from companies and developers, chi is used by thousands of projects around the world -- thank you all as there is no better form of joy for me than to have art I had started be helpful and enjoyed by others. And of course I use chi in all of my own projects too :) -For me, the asthetics of chi's code and usage are very important. With the introduction of Go's module support +For me, the aesthetics of chi's code and usage are very important. With the introduction of Go's module support (which I'm a big fan of), chi's past versioning scheme choice to v2, v3 and v4 would mean I'd require the import path of "github.com/go-chi/chi/v4", leading to the lengthy discussion at https://github.com/go-chi/chi/issues/462. Haha, to some, you may be scratching your head why I've spent > 1 year stalling to adopt "/vXX" convention in the import @@ -289,7 +289,7 @@ Cheers all, happy coding! ## v2.0.0-rc1 (2016-07-26) -- Huge update! chi v2 is a large refactor targetting Go 1.7+. As of Go 1.7, the popular +- Huge update! chi v2 is a large refactor targeting Go 1.7+. As of Go 1.7, the popular community `"net/context"` package has been included in the standard library as `"context"` and utilized by `"net/http"` and `http.Request` to managing deadlines, cancelation signals and other request-scoped values. We're very excited about the new context addition and are proud to diff --git a/_examples/graceful/main.go b/_examples/graceful/main.go index b5f6f048..6ae3750a 100644 --- a/_examples/graceful/main.go +++ b/_examples/graceful/main.go @@ -72,7 +72,7 @@ func service() http.Handler { // so consider the work here as some background routine to fetch a long running // search query to find as many results as possible, but, instead we cut it short // and respond with what we have so far. How a shutdown is handled is entirely - // up to the developer, as some code blocks are preemptable, and others are not. + // up to the developer, as some code blocks are preemptible, and others are not. time.Sleep(5 * time.Second) w.Write([]byte(fmt.Sprintf("all done.\n"))) diff --git a/_examples/rest/main.go b/_examples/rest/main.go index 9e1ed36c..f9c5dcc7 100644 --- a/_examples/rest/main.go +++ b/_examples/rest/main.go @@ -337,7 +337,7 @@ func (a *ArticleRequest) Bind(r *http.Request) error { // a.User is nil if no Userpayload fields are sent in the request. In this app // this won't cause a panic, but checks in this Bind method may be required if - // a.User or futher nested fields like a.User.Name are accessed elsewhere. + // a.User or further nested fields like a.User.Name are accessed elsewhere. // just a post-process after a decode.. a.ProtectedID = "" // unset the protected ID diff --git a/middleware/compress.go b/middleware/compress.go index aa706676..773d47a1 100644 --- a/middleware/compress.go +++ b/middleware/compress.go @@ -135,7 +135,7 @@ func NewCompressor(level int, types ...string) *Compressor { // The encoding should be a standardised identifier. See: // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding // -// For example, add the Brotli algortithm: +// For example, add the Brotli algorithm: // // import brotli_enc "gopkg.in/kothar/brotli-go.v0/enc" // @@ -285,7 +285,7 @@ func (cw *compressResponseWriter) isCompressable() bool { contentType = contentType[0:idx] } - // Is the content type compressable? + // Is the content type compressible? if _, ok := cw.contentTypes[contentType]; ok { return true } diff --git a/middleware/middleware_test.go b/middleware/middleware_test.go index 69df2439..f7a626f4 100644 --- a/middleware/middleware_test.go +++ b/middleware/middleware_test.go @@ -35,7 +35,7 @@ func TestWrapWriterHTTP2(t *testing.T) { } _, rf := w.(io.ReaderFrom) if rf { - t.Fatal("request should not have been a io.ReaderFrom") + t.Fatal("request should not have been an io.ReaderFrom") } _, ps := w.(http.Pusher) if !ps { diff --git a/middleware/throttle_test.go b/middleware/throttle_test.go index 6626e7dc..8ed7ff18 100644 --- a/middleware/throttle_test.go +++ b/middleware/throttle_test.go @@ -34,7 +34,7 @@ func TestThrottleBacklog(t *testing.T) { var wg sync.WaitGroup - // The throttler proccesses 10 consecutive requests, each one of those + // The throttler processes 10 consecutive requests, each one of those // requests lasts 1s. The maximum number of requests this can possible serve // before the clients time out (5s) is 40. for i := 0; i < 40; i++ { diff --git a/mux.go b/mux.go index 47e64cf2..0d1caa6e 100644 --- a/mux.go +++ b/mux.go @@ -156,7 +156,7 @@ func (mx *Mux) Head(pattern string, handlerFn http.HandlerFunc) { mx.handle(mHEAD, pattern, handlerFn) } -// Options adds the route `pattern` that matches a OPTIONS http method to +// Options adds the route `pattern` that matches an OPTIONS http method to // execute the `handlerFn` http.HandlerFunc. func (mx *Mux) Options(pattern string, handlerFn http.HandlerFunc) { mx.handle(mOPTIONS, pattern, handlerFn)