diff --git a/app.go b/app.go index 694aaf38..810839c6 100644 --- a/app.go +++ b/app.go @@ -383,7 +383,7 @@ func New(config ...Config) *App { return app } -// Mount attaches another app instance as a subrouter along a routing path. +// Mount attaches another app instance as a sub-router along a routing path. // It's very useful to split up a large API as many independent routers and // compose them as a single service using Mount. func (app *App) Mount(prefix string, fiber *App) Router { @@ -663,7 +663,7 @@ func (app *App) Test(req *http.Request, msTimeout ...int) (resp *http.Response, type disableLogger struct{} -func (dl *disableLogger) Printf(format string, args ...interface{}) { +func (dl *disableLogger) Printf(_ string, _ ...interface{}) { // fmt.Println(fmt.Sprintf(format, args...)) } @@ -917,6 +917,5 @@ func (app *App) startupMessage(addr string, tls bool, pids string) { out = colorable.NewNonColorable(os.Stdout) } - fmt.Fprintln(out, output) - + _, _ = fmt.Fprintln(out, output) } diff --git a/ctx.go b/ctx.go index f8cc2a11..0791acbc 100644 --- a/ctx.go +++ b/ctx.go @@ -946,7 +946,7 @@ func (c *Ctx) SendFile(file string, compress ...bool) error { }) // Keep original path for mutable params - c.pathOriginal = utils.SafeString(c.pathOriginal) + c.pathOriginal = utils.CopyString(c.pathOriginal) // Disable compression if len(compress) <= 0 || !compress[0] { // https://github.com/valyala/fasthttp/blob/master/fs.go#L46 @@ -1098,7 +1098,7 @@ func (c *Ctx) WriteString(s string) (int, error) { // XHR returns a Boolean property, that is true, if the request's X-Requested-With header field is XMLHttpRequest, // indicating that the request was issued by a client library (such as jQuery). func (c *Ctx) XHR() bool { - return utils.EqualsFold(utils.UnsafeBytes(c.Get(HeaderXRequestedWith)), []byte("xmlhttprequest")) + return utils.EqualFoldBytes(utils.UnsafeBytes(c.Get(HeaderXRequestedWith)), []byte("xmlhttprequest")) } // prettifyPath ... diff --git a/group.go b/group.go index a3b10e4a..6c1b13fd 100644 --- a/group.go +++ b/group.go @@ -15,7 +15,7 @@ type Group struct { prefix string } -// Mount attaches another app instance as a subrouter along a routing path. +// Mount attaches another app instance as a sub-router along a routing path. // It's very useful to split up a large API as many independent routers and // compose them as a single service using Mount. func (grp *Group) Mount(prefix string, fiber *App) Router { diff --git a/helpers.go b/helpers.go index 8c53cbf4..f4612e35 100644 --- a/helpers.go +++ b/helpers.go @@ -364,9 +364,9 @@ func (c *testConn) Close() error { return nil } func (c *testConn) LocalAddr() net.Addr { return testAddr("local-addr") } func (c *testConn) RemoteAddr() net.Addr { return testAddr("remote-addr") } -func (c *testConn) SetDeadline(t time.Time) error { return nil } -func (c *testConn) SetReadDeadline(t time.Time) error { return nil } -func (c *testConn) SetWriteDeadline(t time.Time) error { return nil } +func (c *testConn) SetDeadline(_ time.Time) error { return nil } +func (c *testConn) SetReadDeadline(_ time.Time) error { return nil } +func (c *testConn) SetWriteDeadline(_ time.Time) error { return nil } // getString converts byte slice to a string without memory allocation. var getString = utils.UnsafeString