From cd2e10f103c1d78876f28e1b77582dcf46f50042 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 11 May 2015 20:12:25 +0200 Subject: Rename scan* into New* --- cutter.go | 6 +++--- units.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cutter.go b/cutter.go index 0ed334e..2830994 100644 --- a/cutter.go +++ b/cutter.go @@ -235,17 +235,17 @@ func (c Cutter) returnString() string { func (c Cutter) returnUnit() Unit { s, _ := c.GetResponse() - return scanUnit(s) + return NewUnit(s) } func (c Cutter) returnPoint() Point { s, _ := c.GetResponse() - return scanPoint(s) + return NewPoint(s) } func (c Cutter) returnTriple() Triple { s, _ := c.GetResponse() - return scanTriple(s) + return NewTriple(s) } func (c Cutter) RegMarkLen(n Unit) { diff --git a/units.go b/units.go index e5fb865..b05ac3b 100644 --- a/units.go +++ b/units.go @@ -17,7 +17,7 @@ func (u Unit) String() string { return fmt.Sprintf("%.2f", u) } -func scanUnit(s string) (u Unit) { +func NewUnit(s string) (u Unit) { fmt.Sscanf(s, "%v", &u) return } @@ -30,7 +30,7 @@ func (p Point) String() string { return fmt.Sprintf("%v,%v", p.X, p.Y) } -func scanPoint(s string) (p Point) { +func NewPoint(s string) (p Point) { fmt.Sscanf(s, "%v,%v", &p.X, &p.Y) return } @@ -43,7 +43,7 @@ func (t Triple) String() string { return fmt.Sprintf("%v,%v,%v", t.U, t.V, t.W) } -func scanTriple(s string) (t Triple) { +func NewTriple(s string) (t Triple) { fmt.Sscanf(s, "%v,%v,%v", &t.U, &t.V, &t.W) return } -- cgit v1.2.3