summaryrefslogtreecommitdiff
path: root/test/blank.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
committerRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
commited3592f95664c555d787d87b28ff783b846257e6 (patch)
tree9bfdc7720f6c491c1c293a4bd367abec2a1221f4 /test/blank.go
parent8d36be6d5ae904467a0be5e7dc3965581a3dbf73 (diff)
downloadgo-ed3592f95664c555d787d87b28ff783b846257e6.tar.gz
delete float, complex - code changes
also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev http://codereview.appspot.com/3991043
Diffstat (limited to 'test/blank.go')
-rw-r--r--test/blank.go51
1 files changed, 36 insertions, 15 deletions
diff --git a/test/blank.go b/test/blank.go
index 6e69f8aaa..681a5e77c 100644
--- a/test/blank.go
+++ b/test/blank.go
@@ -28,7 +28,7 @@ const (
c4
)
-var ints = []string {
+var ints = []string{
"1",
"2",
"3",
@@ -36,15 +36,15 @@ var ints = []string {
func f() (int, int) {
call += "f"
- return 1,2
+ return 1, 2
}
-func g() (float, float) {
+func g() (float64, float64) {
call += "g"
- return 3,4
+ return 3, 4
}
-func h(_ int, _ float) {
+func h(_ int, _ float64) {
}
func i() int {
@@ -55,43 +55,64 @@ func i() int {
var _ = i()
func main() {
- if call != "i" {panic("init did not run")}
+ if call != "i" {
+ panic("init did not run")
+ }
call = ""
_, _ = f()
a, _ := f()
- if a != 1 {panic(a)}
+ if a != 1 {
+ panic(a)
+ }
b, _ := g()
- if b != 3 {panic(b)}
+ if b != 3 {
+ panic(b)
+ }
_, a = f()
- if a != 2 {panic(a)}
+ if a != 2 {
+ panic(a)
+ }
_, b = g()
- if b != 4 {panic(b)}
+ if b != 4 {
+ panic(b)
+ }
_ = i()
- if call != "ffgfgi" {panic(call)}
- if c4 != 4 {panic(c4)}
+ if call != "ffgfgi" {
+ panic(call)
+ }
+ if c4 != 4 {
+ panic(c4)
+ }
out := ""
for _, s := range ints {
out += s
}
- if out != "123" {panic(out)}
+ if out != "123" {
+ panic(out)
+ }
sum := 0
for s := range ints {
sum += s
}
- if sum != 3 {panic(sum)}
+ if sum != 3 {
+ panic(sum)
+ }
- h(a,b)
+ h(a, b)
}
// useless but legal
var _ int = 1
var _ = 2
var _, _ = 3, 4
+
const _ = 3
const _, _ = 4, 5
+
type _ int
+
func _() {
panic("oops")
}