]> Cypherpunks repositories - gostls13.git/commitdiff
units: fix compilation
authorRob Pike <r@golang.org>
Wed, 3 Nov 2010 19:20:37 +0000 (12:20 -0700)
committerRob Pike <r@golang.org>
Wed, 3 Nov 2010 19:20:37 +0000 (12:20 -0700)
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/2865041

src/cmd/goyacc/units.y

index bd5517e8be3ea57be2458b9ad4255405370762e1..a7d472fc6c54c1193bf6c477007d35454c2aece3 100644 (file)
@@ -215,7 +215,7 @@ expr0:
 
 type UnitsLex int
 
-func (UnitsLex) Lex(yylval *yySymType) int {
+func (UnitsLex) Lex(yylval *yySymType) int {
        var c, i int
 
        c = peekrune
@@ -280,7 +280,7 @@ numb:
        return VAL
 }
 
-func (UnitsLex) Error(s string) {
+func (UnitsLex) Error(s string) {
        Error("syntax error, last name: %v", sym)
 }
 
@@ -298,7 +298,7 @@ func main() {
 
        f, err := os.Open(file, os.O_RDONLY, 0)
        if err != nil {
-               fmt.Printf("error opening %v: %v\n", file, err)
+               fmt.Fprintf(os.Stderr, "error opening %v: %v\n", file, err)
                os.Exit(1)
        }
        fi = bufio.NewReader(f)
@@ -390,7 +390,7 @@ func rdigit(c int) bool {
 
 func Error(s string, v ...interface{}) {
        fmt.Printf("%v: %v\n\t", lineno, line)
-       fmt.Printf(s, v)
+       fmt.Printf(s, v...)
        fmt.Printf("\n")
 
        nerrors++