Handle an empty argument
This makes it slightly easier to adjust VSCode's launch.json to hop around debugging different days. Not much, but a little. And every little bit helps!
This commit is contained in:
2
main.go
2
main.go
@ -33,7 +33,7 @@ var dayMap = []day{
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
arg := strconv.Itoa(len(dayMap))
|
arg := strconv.Itoa(len(dayMap))
|
||||||
if len(os.Args) > 1 {
|
if len(os.Args) > 1 && len(os.Args[1]) > 0 {
|
||||||
arg = os.Args[1]
|
arg = os.Args[1]
|
||||||
}
|
}
|
||||||
if strings.ToLower(arg) == "all" {
|
if strings.ToLower(arg) == "all" {
|
||||||
|
Reference in New Issue
Block a user