Add a runnable Go example

This commit is contained in:
Simon Drake 2021-06-24 14:40:40 +01:00
commit 5075f3a11a
7 changed files with 125 additions and 1 deletions

View file

@ -0,0 +1,20 @@
package main
import (
"fmt"
"example.com/internal/vowels"
)
func main() {
names := []string{"Simon", "Bob", "Jennifer", "Amy", "Duke", "Elizabeth"}
for _, n := range names {
if vowels.NameStartsWithVowel(n) {
fmt.Printf("%s starts with a vowel!\n", n)
continue
}
fmt.Printf("%s does not start with a vowel!\n", n)
}
}