Changed code to use new rune type unicode code points.

pull/4/head
jim teeuwen 2011-10-26 11:59:30 +02:00
parent 2985202b2b
commit 5b255b58ee
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ func main() {
fmt.Fprintln(os.Stderr, "[w] No package name specified. Using 'main'.")
*pkgname = "main"
} else {
if unicode.IsDigit(int((*pkgname)[0])) {
if unicode.IsDigit(rune((*pkgname)[0])) {
// Identifier can't start with a digit.
*pkgname = "_" + *pkgname
}
@ -80,7 +80,7 @@ func main() {
file = strings.Replace(file, " ", "_", -1)
file = strings.Replace(file, ".", "_", -1)
file = strings.Replace(file, "-", "_", -1)
if unicode.IsDigit(int(file[0])) {
if unicode.IsDigit(rune(file[0])) {
// Identifier can't start with a digit.
file = "_" + file
}