summaryrefslogtreecommitdiff
path: root/philo.go
diff options
context:
space:
mode:
Diffstat (limited to 'philo.go')
-rw-r--r--philo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/philo.go b/philo.go
index 811c698..030195c 100644
--- a/philo.go
+++ b/philo.go
@@ -1,6 +1,7 @@
package main
import (
+ "errors"
"flag"
"fmt"
"math/rand"
@@ -106,6 +107,9 @@ func (n Names) String() string {
func (n *Names) Set(s string) error {
*n = Names(strings.Split(s, ","))
+ if len(*n) < 2 {
+ return errors.New("at least 2 names are required")
+ }
return nil
}