dubeejw commented on a change in pull request #2326: (Review) Alphabetize
URL:
https://github.com/apache/incubator-openwhisk/pull/2326#discussion_r125915976
##########
File path: tools/cli/go-whisk-cli/commands/util.go
##########
@@ -243,28 +243,79 @@ func getEscapedJSON(value string) (string) {
func isValidJSON(value string) (bool) {
var jsonInterface interface{}
err := json.Unmarshal([]byte(value), &jsonInterface)
+
return err == nil
}
var boldString = color.New(color.Bold).SprintFunc()
+type SortCmds []whisk.Sortable
+// Uses Go builtin sort to sort commands based on their compare methods
+// Param: Takes in a array of Sortable interfaces which contains a specific
command
+func (s SortCmds) Len() int { return len(s) }
+func (s SortCmds) Less(i,j int) bool { return s[i].Compare(s[j]) }
+func (s SortCmds) Swap(i,j int) { s[i], s[j] = s[j], s[i] }
Review comment:
Space after `i,`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services