👷 fix lint

pull/1044/head
Kiyon 2020-11-30 13:49:13 +08:00
parent 9233932c39
commit d6d831e2b1
4 changed files with 9 additions and 10 deletions

7
app.go
View File

@ -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)
}

4
ctx.go
View File

@ -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 ...

View File

@ -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 {

View File

@ -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