Skip to content

Commit

Permalink
fix(typo): fix some typo (#12673)
Browse files Browse the repository at this point in the history
Signed-off-by: googs1025 <googs1025@gmail.com>
Co-authored-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Isitha Subasinghe <isubasinghe@student.unimelb.edu.au>
  • Loading branch information
2 people authored and isubasinghe committed Feb 28, 2024
1 parent ea753f0 commit 8207a08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions server/auth/types/claims.go
Expand Up @@ -61,19 +61,19 @@ func (c *Claims) UnmarshalJSON(data []byte) error {
func (c *Claims) GetCustomGroup(customKeyName string) ([]string, error) {
groups, ok := c.RawClaim[customKeyName]
if !ok {
return nil, fmt.Errorf("No claim found for key: %v", customKeyName)
return nil, fmt.Errorf("no claim found for key: %v", customKeyName)
}

sliceInterface, ok := groups.([]interface{})
if !ok {
return nil, fmt.Errorf("Expected an array, got %v", groups)
return nil, fmt.Errorf("expected an array, got %v", groups)
}

newSlice := []string{}
for _, a := range sliceInterface {
val, ok := a.(string)
if !ok {
return nil, fmt.Errorf("Group name %v was not a string", a)
return nil, fmt.Errorf("group name %v was not a string", a)
}
newSlice = append(newSlice, val)
}
Expand Down
4 changes: 2 additions & 2 deletions server/auth/types/claims_test.go
Expand Up @@ -159,7 +159,7 @@ func TestGetCustomGroup(t *testing.T) {
claims := &Claims{}
_, err := claims.GetCustomGroup(("ad_groups"))
if assert.Error(t, err) {
assert.EqualError(t, err, "No claim found for key: ad_groups")
assert.EqualError(t, err, "no claim found for key: ad_groups")
}
})
t.Run("CustomGroupSet", func(t *testing.T) {
Expand Down Expand Up @@ -187,7 +187,7 @@ func TestGetCustomGroup(t *testing.T) {
}}
_, err := claims.GetCustomGroup(("ad_groups"))
if assert.Error(t, err) {
assert.EqualError(t, err, "Group name 0 was not a string")
assert.EqualError(t, err, "group name 0 was not a string")
}
})
t.Run("CustomGroupNotSlice", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions server/workflow/workflow_server.go
Expand Up @@ -335,7 +335,7 @@ func (s *workflowServer) WatchEvents(req *workflowpkg.WatchEventsRequest, ws wor
log.Debug("Received event")
e, ok := event.Object.(*corev1.Event)
if !ok {
// object is probably probably metav1.Status, `FromObject` can deal with anything
// object is probably metav1.Status, `FromObject` can deal with anything
return sutils.ToStatusError(apierr.FromObject(event.Object), codes.Internal)
}
log.Debug("Sending event")
Expand Down Expand Up @@ -665,7 +665,7 @@ func getLatestWorkflow(ctx context.Context, wfClient versioned.Interface, namesp
return nil, sutils.ToStatusError(err, codes.Internal)
}
if len(wfList.Items) < 1 {
return nil, sutils.ToStatusError(fmt.Errorf("No workflows found."), codes.NotFound)
return nil, sutils.ToStatusError(fmt.Errorf("no workflows found"), codes.NotFound)
}
latest := wfList.Items[0]
for _, wf := range wfList.Items {
Expand Down

0 comments on commit 8207a08

Please sign in to comment.