Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: set up go
uses: actions/setup-go@v5
with:
go-version: "1.23"
id: go

- name: checkout
uses: actions/checkout@v4

- name: build and test
run: |
go get -v
go test -timeout=60s -race -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" > $GITHUB_WORKSPACE/profile.cov
go build -race
env:
GO111MODULE: "on"
TZ: "America/Chicago"

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.64
version: latest

- name: install goveralls
run: |
Expand All @@ -42,4 +40,4 @@ jobs:
- name: submit coverage
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107 changes: 52 additions & 55 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,63 @@
version: "2"
run:
timeout: 5m
tests: false

linters-settings:
govet:
enable:
- shadow
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
lll:
line-length: 140
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
- hugeParam
- rangeValCopy
- singleCaseSwitch
- ifElseChain

concurrency: 4
linters:
default: none
enable:
- revive
- govet
- unconvert
- staticcheck
- unused
- gosec
- dupl
- misspell
- unparam
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- copyloopvar
- gocritic
- govet
- ineffassign
- misspell
- nakedret
- gosimple
- prealloc
fast: false
disable-all: true

issues:
exclude-dirs:
- vendor
exclude-rules:
- text: "at least one file in a package should have a package comment"
linters:
- stylecheck
- text: "should have a package comment"
linters:
- revive
- path: _test\.go
linters:
- gosec
- dupl
exclude-use-default: false
- revive
- staticcheck
- unconvert
- unparam
- unused
settings:
goconst:
min-len: 2
min-occurrences: 2
gocritic:
disabled-checks:
- wrapperFunc
- hugeParam
- rangeValCopy
- singleCaseSwitch
- ifElseChain
enabled-tags:
- performance
- style
- experimental
govet:
enable-all: true
disable:
- fieldalignment
lll:
line-length: 140
misspell:
locale: US

exclusions:
generated: lax
rules:
- linters:
- staticcheck
text: "at least one file in a package should have a package comment"
- linters:
- revive
text: "should have a package comment"
- linters:
- gosec
- dupl
path: _test\.go
paths:
- vendor
- third_party$
- builtin$
- examples$
2 changes: 2 additions & 0 deletions file_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ func NewFileServer(public, local string, options ...FsOpt) (*FS, error) {
}

// FileServer is a shortcut for making FS with listing disabled and the custom noFound reader (can be nil).
//
// Deprecated: the method is for back-compatibility only and user should use the universal NewFileServer instead
func FileServer(public, local string, notFound io.Reader) (http.Handler, error) {
return NewFileServer(public, local, FsOptCustom404(notFound))
}

// FileServerSPA is a shortcut for making FS with SPA-friendly handling of 404, listing disabled and the custom noFound reader (can be nil).
//
// Deprecated: the method is for back-compatibility only and user should use the universal NewFileServer instead
func FileServerSPA(public, local string, notFound io.Reader) (http.Handler, error) {
return NewFileServer(public, local, FsOptCustom404(notFound), FsOptSPA)
Expand Down
2 changes: 1 addition & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,5 @@ func (c *customResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
if hj, ok := c.ResponseWriter.(http.Hijacker); ok {
return hj.Hijack()
}
return nil, nil, fmt.Errorf("ResponseWriter does not implement the Hijacker interface") //nolint:golint //capital letter is OK here
return nil, nil, fmt.Errorf("ResponseWriter does not implement the Hijacker interface")
}