WithRoles variadic args (#1395)
Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
@@ -37,7 +37,7 @@ func TestInspect(t *testing.T) {
|
||||
|
||||
opts := []token.GenerateOption{
|
||||
token.WithMetadata(md),
|
||||
token.WithRoles(roles),
|
||||
token.WithRoles(roles...),
|
||||
}
|
||||
|
||||
tok, err := b.Generate(subject, opts...)
|
||||
|
@@ -46,7 +46,7 @@ func TestInspect(t *testing.T) {
|
||||
|
||||
opts := []token.GenerateOption{
|
||||
token.WithMetadata(md),
|
||||
token.WithRoles(roles),
|
||||
token.WithRoles(roles...),
|
||||
}
|
||||
|
||||
tok, err := j.Generate(subject, opts...)
|
||||
|
@@ -76,7 +76,7 @@ func WithMetadata(md map[string]string) func(o *GenerateOptions) {
|
||||
}
|
||||
|
||||
// WithRoles for the token
|
||||
func WithRoles(rs []string) func(o *GenerateOptions) {
|
||||
func WithRoles(rs ...string) func(o *GenerateOptions) {
|
||||
return func(o *GenerateOptions) {
|
||||
o.Roles = rs
|
||||
}
|
||||
|
Reference in New Issue
Block a user