diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
commit | 4cecda6c347bd6902b960c6a35a967add7070b0d (patch) | |
tree | a462e224ff41ec9f3eb1a0b6e815806f9e8804ad /doc/talks/io2010 | |
parent | 6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff) | |
download | golang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz |
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'doc/talks/io2010')
-rw-r--r-- | doc/talks/io2010/balance.go | 2 | ||||
-rw-r--r-- | doc/talks/io2010/decrypt.go | 4 | ||||
-rw-r--r-- | doc/talks/io2010/encrypt.go | 2 | ||||
-rw-r--r-- | doc/talks/io2010/eval1.go | 6 | ||||
-rw-r--r-- | doc/talks/io2010/eval2.go | 6 |
5 files changed, 8 insertions, 12 deletions
diff --git a/doc/talks/io2010/balance.go b/doc/talks/io2010/balance.go index b01f7468c..a3825cbc5 100644 --- a/doc/talks/io2010/balance.go +++ b/doc/talks/io2010/balance.go @@ -8,7 +8,7 @@ import ( "container/heap" "flag" "fmt" - "rand" + "math/rand" "time" ) diff --git a/doc/talks/io2010/decrypt.go b/doc/talks/io2010/decrypt.go index 0a6c006e2..e63418b1a 100644 --- a/doc/talks/io2010/decrypt.go +++ b/doc/talks/io2010/decrypt.go @@ -15,7 +15,7 @@ import ( "os" ) -func EncryptAndGzip(dstfile, srcfile string, key, iv []byte) os.Error { +func EncryptAndGzip(dstfile, srcfile string, key, iv []byte) error { r, err := os.Open(srcfile) if err != nil { return err @@ -39,7 +39,7 @@ func EncryptAndGzip(dstfile, srcfile string, key, iv []byte) os.Error { return err } -func DecryptAndGunzip(dstfile, srcfile string, key, iv []byte) os.Error { +func DecryptAndGunzip(dstfile, srcfile string, key, iv []byte) error { f, err := os.Open(srcfile) if err != nil { return err diff --git a/doc/talks/io2010/encrypt.go b/doc/talks/io2010/encrypt.go index c6508bba1..57c888c74 100644 --- a/doc/talks/io2010/encrypt.go +++ b/doc/talks/io2010/encrypt.go @@ -15,7 +15,7 @@ import ( "os" ) -func EncryptAndGzip(dstfile, srcfile string, key, iv []byte) os.Error { +func EncryptAndGzip(dstfile, srcfile string, key, iv []byte) error { r, err := os.Open(srcfile) if err != nil { return err diff --git a/doc/talks/io2010/eval1.go b/doc/talks/io2010/eval1.go index 2d7fc3be6..582f43e8e 100644 --- a/doc/talks/io2010/eval1.go +++ b/doc/talks/io2010/eval1.go @@ -101,7 +101,6 @@ func main() { } } - // Custom grammar and values var precTab = map[string]int{ @@ -125,7 +124,7 @@ func newVal(lit string) Value { if err == nil { return Int(x) } - b, err := strconv.Atob(lit) + b, err := strconv.ParseBool(lit) if err == nil { return Bool(b) } @@ -175,7 +174,7 @@ func (x Int) BinaryOp(op string, y Value) Value { type Bool bool -func (x Bool) String() string { return strconv.Btoa(bool(x)) } +func (x Bool) String() string { return strconv.FormatBool(bool(x)) } func (x Bool) BinaryOp(op string, y Value) Value { switch y := y.(type) { case Error: @@ -195,7 +194,6 @@ func (x Bool) BinaryOp(op string, y Value) Value { return Error(fmt.Sprintf("illegal operation: '%v %s %v'", x, op, y)) } - func trace(newVal func(string) Value) func(string) Value { return func(s string) Value { v := newVal(s) diff --git a/doc/talks/io2010/eval2.go b/doc/talks/io2010/eval2.go index 5524c8b3a..6f826e12d 100644 --- a/doc/talks/io2010/eval2.go +++ b/doc/talks/io2010/eval2.go @@ -101,7 +101,6 @@ func main() { } } - // Custom grammar and values var precTab = map[string]int{ @@ -125,7 +124,7 @@ func newVal(lit string) Value { if err == nil { return Int(x) } - b, err := strconv.Atob(lit) + b, err := strconv.ParseBool(lit) if err == nil { return Bool(b) } @@ -184,7 +183,7 @@ func (x Int) BinaryOp(op string, y Value) Value { type Bool bool -func (x Bool) String() string { return strconv.Btoa(bool(x)) } +func (x Bool) String() string { return strconv.FormatBool(bool(x)) } func (x Bool) BinaryOp(op string, y Value) Value { switch y := y.(type) { case Error: @@ -227,7 +226,6 @@ func (x String) BinaryOp(op string, y Value) Value { return Error(fmt.Sprintf("illegal operation: '%v %s %v'", x, op, y)) } - func trace(newVal func(string) Value) func(string) Value { return func(s string) Value { v := newVal(s) |