From 5b255b58ee47df2a68cd764d1f81b4ccfd3057f1 Mon Sep 17 00:00:00 2001 From: jim teeuwen Date: Wed, 26 Oct 2011 11:59:30 +0200 Subject: [PATCH] Changed code to use new rune type unicode code points. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 863d2d4..3cbd809 100644 --- a/main.go +++ b/main.go @@ -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 }