docs: Check license year

This commit is contained in:
Hajime Hoshi 2015-01-09 01:50:11 +09:00
parent 4322122664
commit 02b1f7d798

View File

@ -25,6 +25,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv"
"strings" "strings"
"time" "time"
) )
@ -38,7 +39,13 @@ func init() {
} }
license = strings.TrimSpace(string(b)) license = strings.TrimSpace(string(b))
// TODO: Year check year, err := strconv.Atoi(regexp.MustCompile(`^Copyright (\d+)`).FindStringSubmatch(license)[1])
if err != nil {
panic(err)
}
if year != time.Now().Year() {
panic("the license's year is not this year")
}
} }
var copyright = "" var copyright = ""