diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-15 13:29:31 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-15 13:29:31 +0200 |
commit | b2bfa9c8f48fced0776986c68135a75f9c3f3a46 (patch) | |
tree | b524128059644fcd0a9f874a0fd22091018aef5c /units.go | |
parent | 45480ea2d167ec9107b837bf14102531521366ab (diff) |
Rename New... to parse...
Diffstat (limited to 'units.go')
-rw-r--r-- | units.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -15,13 +15,13 @@ type Unit float64 func (u Unit) String() string { if u == Unit(int(u)) { - return fmt.Sprintf("%d", int(u)) + return fmt.Sprint(int(u)) } else { return fmt.Sprintf("%.2f", u) } } -func NewUnit(s string) (u Unit) { +func parseUnit(s string) (u Unit) { fmt.Sscanf(s, "%v", &u) return } @@ -34,7 +34,7 @@ func (p Point) String() string { return fmt.Sprintf("%v,%v", p.X, p.Y) } -func NewPoint(s string) (p Point) { +func parsePoint(s string) (p Point) { fmt.Sscanf(s, "%v,%v", &p.X, &p.Y) return } @@ -47,7 +47,7 @@ func (t Triple) String() string { return fmt.Sprintf("%v,%v,%v", t.U, t.V, t.W) } -func NewTriple(s string) (t Triple) { +func parseTriple(s string) (t Triple) { fmt.Sscanf(s, "%v,%v,%v", &t.U, &t.V, &t.W) return } |