Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Dmytrenko <[email protected]>
  • Loading branch information
erka committed Dec 11, 2024
1 parent df7a7b8 commit 2a15c11
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions rpc/flipt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,9 @@ type Request struct {
Status Status `json:"status"`
}

func WithNoNamespace() func(*Request) {
return func(r *Request) {
r.Namespace = ""
}
}

func WithNamespace(ns string) func(*Request) {
return func(r *Request) {
if ns != "" {
r.Namespace = ns
}
r.Namespace = ns
}
}

Expand Down Expand Up @@ -104,7 +96,7 @@ func (req *GetNamespaceRequest) Request() []Request {
}

func (req *ListNamespaceRequest) Request() []Request {
return []Request{NewRequest(ResourceNamespace, ActionRead, WithNoNamespace())}
return []Request{NewRequest(ResourceNamespace, ActionRead, WithNamespace(""))}
}

func (req *CreateNamespaceRequest) Request() []Request {
Expand Down

0 comments on commit 2a15c11

Please sign in to comment.