diff options
| author | Andrew Gerrand <adg@golang.org> | 2016-01-05 16:43:40 +1100 |
|---|---|---|
| committer | Andrew Gerrand <adg@golang.org> | 2016-01-07 02:11:17 +0000 |
| commit | fe12a66e2eb3cf260ea027cfaf5a6b2c9194c7dc (patch) | |
| tree | 279ab263b6b17f3b239a35924c65fbcf944dd37e /content/methods/methods.go | |
| parent | 4e6c47c1628134f8c4a5fd58b7b61ac30a25b632 (diff) | |
| download | golang-id-tour-fe12a66e2eb3cf260ea027cfaf5a6b2c9194c7dc.tar.xz | |
content: expand discussion of methods
Fixes golang/go#13818
Change-Id: I22817c0c3bfa3d7e5a769f239a2521c293112a43
Reviewed-on: https://go-review.googlesource.com/18246
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'content/methods/methods.go')
| -rw-r--r-- | content/methods/methods.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/methods/methods.go b/content/methods/methods.go index 8347705..692a095 100644 --- a/content/methods/methods.go +++ b/content/methods/methods.go @@ -11,11 +11,11 @@ type Vertex struct { X, Y float64 } -func (v *Vertex) Abs() float64 { +func (v Vertex) Abs() float64 { return math.Sqrt(v.X*v.X + v.Y*v.Y) } func main() { - v := &Vertex{3, 4} + v := Vertex{3, 4} fmt.Println(v.Abs()) } |
