Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick0308 committed Oct 4, 2023
1 parent d65aa42 commit fb074c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ linters-settings:
- FIXME
gofumpt:
extra-rules: true
decorder:
ignore-underscore-vars: true

linters:
enable-all: true
ignore-underscore-vars: true
disable:
- deadcode # deprecated
- exhaustivestruct # deprecated
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--experimental.plugins.session-max-age.modulename=github.com/longbridgeapp/traefik-session-max-age"
- "--experimental.plugins.session-max-age.version=v0.1.2"
- "--experimental.plugins.session-max-age.version=v0.1.0"
ports:
- "80:80"
- "8080:8080"
Expand Down
6 changes: 4 additions & 2 deletions max_age.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package traefik_session_max_age is a plugin for the Traefik reverse proxy
// that sets cookie's max-age
package traefik_session_max_age

import (
Expand Down Expand Up @@ -44,15 +46,15 @@ func (rww responseWriterWrapper) Write(b []byte) (int, error) {
return rww.ResponseWriter.Write(b)
}

// SessionMaxAge is a middleware for traefik middlware plugin to set cookie max age
// SessionMaxAge is a middleware for traefik middlware plugin to set cookie max age.
type SessionMaxAge struct {
next http.Handler
cookieName string
maxAge int
name string
}

// New return a wrapped http.Handler
// New return a wrapped http.Handler.
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
return &SessionMaxAge{
next: next,
Expand Down

0 comments on commit fb074c1

Please sign in to comment.