Skip to content

Commit

Permalink
fix(typo): fix some typo (argoproj#12673)
Browse files Browse the repository at this point in the history
Signed-off-by: googs1025 <[email protected]>
Co-authored-by: Julie Vogelman <[email protected]>
  • Loading branch information
googs1025 and juliev0 authored Feb 17, 2024
1 parent 030d581 commit 57a078f
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,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
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,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 @@ -209,7 +209,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
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,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 @@ -688,7 +688,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 57a078f

Please sign in to comment.