Skip to content

Interface Section: Reduce verbosity when returning Boolean  #55

@kkruups

Description

@kkruups

Hi Big Yuuta,

Kudos! Great Work!

One minor style change I would like to request in your interface section for interface method(s) which return a boolean.

You write :
`

 func (g HumanGroup) Less(i, j int) bool {
       if g[i].age < g[j].age {
           return true
        }
        return false
   }

`
But the following is more concise, cleaner and is inline with Golang Idiom:

`
func (g HumanGroup) Less(i, j int) bool {

    return g[i].age < g[j].age 

}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions