Add initial project files
This commit is contained in:
19
pkg/people/power.go
Normal file
19
pkg/people/power.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package people
|
||||
|
||||
import "strings"
|
||||
|
||||
// SuperPowers list of an SuperHero.
|
||||
// Normal person has no super-power?
|
||||
// Perhaps we just don't know enough to distinguish the qualities in each individual person. Sad but true.
|
||||
type SuperPowers []string
|
||||
|
||||
// Contains superpower list the strength?
|
||||
// Not go idiomatic? Okay, we can discuss it.
|
||||
func (s *SuperPowers) Contains(power string) bool {
|
||||
for _, p := range *s {
|
||||
if strings.EqualFold(p, power) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user