From be6484b1e9e0d14cdb1523f5771921d637a1bb50 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 18 May 2015 00:10:46 +0200 Subject: minor --- units.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/units.go b/units.go index 81e48c7..726829d 100644 --- a/units.go +++ b/units.go @@ -34,12 +34,14 @@ type Point struct { var orientation = Portrait -func (p Point) String() string { - if orientation == Portrait { - return fmt.Sprintf("%v,%v", p.X, p.Y) - } else { - return fmt.Sprintf("%v,%v", p.Y, p.X) +func (p Point) String() (s string) { + switch orientation { + case Portrait: + s = fmt.Sprintf("%v,%v", p.X, p.Y) + case Landscape: + s = fmt.Sprintf("%v,%v", p.Y, p.X) } + return } func parsePoint(s string) (p Point) { -- cgit v1.2.3