aboutsummaryrefslogtreecommitdiff
path: root/units.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-15 13:29:31 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-15 13:29:31 +0200
commitb2bfa9c8f48fced0776986c68135a75f9c3f3a46 (patch)
treeb524128059644fcd0a9f874a0fd22091018aef5c /units.go
parent45480ea2d167ec9107b837bf14102531521366ab (diff)
Rename New... to parse...
Diffstat (limited to 'units.go')
-rw-r--r--units.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/units.go b/units.go
index 686d5f2..7e3d12e 100644
--- a/units.go
+++ b/units.go
@@ -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
}