xkcd-go

Golang tool to read latest, random, or a specific xkcd comic (and download it too).
git clone http://git.hanabi.in/repos/xkcd-go.git
Log | Files | Refs | README | LICENSE

default-behaviour.go (225B)


      1 package xkcd
      2 
      3 import "strconv"
      4 
      5 func DefaultBehaviour(option string) (msg string) {
      6 	if maybenum, err := strconv.Atoi(option); err == nil {
      7 		msg = FetchThisXKCD(maybenum)
      8 	} else {
      9 		msg = FetchLatestXKCD()
     10 	}
     11 	return msg
     12 }