summaryrefslogtreecommitdiff
path: root/test/test0.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/test0.go')
-rw-r--r--test/test0.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/test0.go b/test/test0.go
index 4d7b0df1f..a3691fb46 100644
--- a/test/test0.go
+++ b/test/test0.go
@@ -4,7 +4,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package Test0
+package main
const
a_const = 0
@@ -26,8 +26,9 @@ type (
Point2 Point
)
-func (p *Point) Initialize(x, y int) {
+func (p *Point) Initialize(x, y int) *Point {
p.x, p.y = x, y;
+ return p;
}
func (p *Point) Distance() int {
@@ -54,7 +55,7 @@ func swap(x, y int) (u, v int) {
}
func control_structs() {
- var p Point = new(Point).Initialize(2, 3);
+ var p *Point = new(Point).Initialize(2, 3);
i := p.Distance();
var f float = 0.3;
for {}
@@ -78,3 +79,6 @@ func control_structs() {
break;
}
}
+
+func main() {
+}