Skip to content

Commit

Permalink
chore: fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Oct 19, 2022
1 parent 9e2c44f commit b2bcb4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ linters-settings:

linters:
enable:
- deadcode
- unused
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- nakedret
- gofmt
- rowserrcheck
Expand Down
4 changes: 2 additions & 2 deletions recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package flamego
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"runtime"

"github.com/flamego/flamego/inject"
Expand Down Expand Up @@ -109,7 +109,7 @@ pre {
// Print this much at least. If we can't find the source, it won't show.
_, _ = fmt.Fprintf(buf, "%s:%d (0x%x)\n", file, line, pc)
if file != lastFile {
data, err := ioutil.ReadFile(file)
data, err := os.ReadFile(file)
if err != nil {
continue
}
Expand Down
11 changes: 6 additions & 5 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ type Route struct {
// addition to the request path.
//
// For example:
// f.Get("/", ...).Headers(
// "User-Agent", "Chrome", // Loose match
// "Host", "^flamego\.dev$", // Exact match
// "Cache-Control", "", // As long as "Cache-Control" is not empty
// )
//
// f.Get("/", ...).Headers(
// "User-Agent", "Chrome", // Loose match
// "Host", "^flamego\.dev$", // Exact match
// "Cache-Control", "", // As long as "Cache-Control" is not empty
// )
//
// Subsequent calls to Headers() replace previously set matches.
func (r *Route) Headers(pairs ...string) *Route {
Expand Down

0 comments on commit b2bcb4d

Please sign in to comment.