Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
panshuai111 committed Nov 17, 2023
1 parent 5d5166f commit 3c40387
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/search/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
)

const (
Equals string = "="
DSLPatternType = "dsl"
SQLPatternType = "sql"
Equals = "="
DSLPatternType = "dsl"
SQLPatternType = "sql"
)

type Storage interface {
Expand Down
5 changes: 3 additions & 2 deletions pkg/util/filters/search_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"github.com/KusionStack/karbour/pkg/search/storage"
)

type ctxTyp string

const (
searchQueryKey = "query"
patternTypeKey = "patternType"
Expand Down Expand Up @@ -63,6 +65,5 @@ func FromQueryToContext(req *http.Request, key string, defaultVal string) *http.
query.Del(key)
val = queryVal[0]
}

return req.WithContext(context.WithValue(req.Context(), key, val))
return req.WithContext(context.WithValue(req.Context(), ctxTyp(key), val))
}

0 comments on commit 3c40387

Please sign in to comment.