summaryrefslogtreecommitdiff
path: root/test/map.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-03 08:39:12 -0800
committerRuss Cox <rsc@golang.org>2009-03-03 08:39:12 -0800
commit518ebed3d37d9e2ca3092b9fef3e8b7f338dff8e (patch)
tree028f4f1a5f6b78795c1a1ef840b49c7da342edd1 /test/map.go
parentdab379ca0d53983fc0aa6184a8faf409fa0aa297 (diff)
downloadgo-518ebed3d37d9e2ca3092b9fef3e8b7f338dff8e.tar.gz
Automated g4 rollback of changelist 25024,
plus significant hand editing. Back to T{x} for composite literals. R=r OCL=25612 CL=25632
Diffstat (limited to 'test/map.go')
-rw-r--r--test/map.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/map.go b/test/map.go
index f0b7b9b00..085502bf5 100644
--- a/test/map.go
+++ b/test/map.go
@@ -27,9 +27,9 @@ func P(a []string) string {
func main() {
// Test a map literal.
- mlit := map[string] int ( "0":0, "1":1, "2":2, "3":3, "4":4 );
+ mlit := map[string] int { "0":0, "1":1, "2":2, "3":3, "4":4 };
for i := 0; i < len(mlit); i++ {
- s := string([]byte(byte(i)+'0'));
+ s := string([]byte{byte(i)+'0'});
if mlit[s] != i {
fmt.Printf("mlit[%s] = %d\n", s, mlit[s])
}
@@ -64,14 +64,14 @@ func main() {
s := strconv.Itoa(i);
s10 := strconv.Itoa(i*10);
f := float(i);
- t := T(int64(i),f);
+ t := T{int64(i),f};
apT[i] = new(T);
apT[i].i = int64(i);
apT[i].f = f;
apT[2*i] = new(T); // need twice as many entries as we use, for the nonexistence check
apT[2*i].i = int64(i);
apT[2*i].f = f;
- m := M(i: i+1);
+ m := M{i: i+1};
mib[i] = (i != 0);
mii[i] = 10*i;
mfi[float(i)] = 10*i;
@@ -140,7 +140,7 @@ func main() {
s := strconv.Itoa(i);
s10 := strconv.Itoa(i*10);
f := float(i);
- t := T(int64(i), f);
+ t := T{int64(i), f};
// BUG m := M(i, i+1);
if mib[i] != (i != 0) {
fmt.Printf("mib[%d] = %t\n", i, mib[i]);
@@ -193,7 +193,7 @@ func main() {
for i := 0; i < count; i++ {
s := strconv.Itoa(i);
f := float(i);
- t := T(int64(i), f);
+ t := T{int64(i), f};
{
a, b := mib[i];
if !b {
@@ -331,7 +331,7 @@ func main() {
for i := count; i < 2*count; i++ {
s := strconv.Itoa(i);
f := float(i);
- t := T(int64(i),f);
+ t := T{int64(i),f};
{
a, b := mib[i];
if b {