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

explain-xkcd.go (292B)


      1 package xkcd
      2 
      3 import (
      4 	"fmt"
      5 )
      6 
      7 // For a given xkcd comic number `num', provide the explainxkcd.com link.
      8 func ExplainXKCD(num int) (link string) {
      9 	if num == 0 {
     10 		link = fmt.Sprintf("%sMain_Page\n", explainxkcd)
     11 	} else {
     12 		link = fmt.Sprintf("%s%d\n", explainxkcd, num)
     13 	}
     14 	return link
     15 }