Skip to content

Commit

Permalink
fix: Traefik plugin analyzer can't find package traefik_request_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ducdetronquito committed Jul 28, 2023
1 parent fc8d0b2 commit e15e258
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ issues:
exclude-use-default: false
max-per-linter: 0
max-same-issues: 0
exclude: []
exclude:
- "var-naming: don't use an underscore in package name"
- "ST1003: should not use underscores in package names"
exclude-rules:
- path: (.+)_test.go
linters:
Expand Down
4 changes: 2 additions & 2 deletions requestid.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package requestid a Traefik plugin to add request ID to incoming HTTP requests.
package requestid
// Package traefik_request_id a Traefik plugin to add request ID to incoming HTTP requests.
package traefik_request_id

import (
"context"
Expand Down
12 changes: 5 additions & 7 deletions requestid_test.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package requestid_test
package traefik_request_id

import (
"context"
"net/http"
"net/http/httptest"
"testing"

plugin "github.com/ZeroGachis/traefik-request-id"
)

func TestAddRequestIdInHeaderIfNoneExist(t *testing.T) {
cfg := plugin.CreateConfig()
cfg := CreateConfig()

ctx := context.Background()
next := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {})

handler, err := plugin.New(ctx, next, cfg, "sw-request-id-plugin")
handler, err := New(ctx, next, cfg, "sw-request-id-plugin")
if err != nil {
t.Fatal(err)
}
Expand All @@ -36,12 +34,12 @@ func TestAddRequestIdInHeaderIfNoneExist(t *testing.T) {
}

func TestKeepRequestIdInHeaderIfOneExist(t *testing.T) {
cfg := plugin.CreateConfig()
cfg := CreateConfig()

ctx := context.Background()
next := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {})

handler, err := plugin.New(ctx, next, cfg, "sw-request-id-plugin")
handler, err := New(ctx, next, cfg, "sw-request-id-plugin")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e15e258

Please sign in to comment.