aboutsummaryrefslogtreecommitdiffstats
path: root/temperature.go
diff options
context:
space:
mode:
Diffstat (limited to 'temperature.go')
-rw-r--r--temperature.go21
1 files changed, 1 insertions, 20 deletions
diff --git a/temperature.go b/temperature.go
index ac8cae0..ea4bd2d 100644
--- a/temperature.go
+++ b/temperature.go
@@ -1,9 +1,6 @@
package main
-import (
- "errors"
- "fmt"
-)
+import "fmt"
type TemperatureUnit int
@@ -13,22 +10,6 @@ const (
Fahrenheit
)
-var TemperatureUnits = []string{"°C", "°K", "°F"}
-
-func ParseTemperatureUnit(s string) (TemperatureUnit, error) {
- // Each case corresponds to a value in UnitStrings().
- switch s {
- case "°C":
- return Celcius, nil
- case "°K":
- return Kelvin, nil
- case "°F":
- return Fahrenheit, nil
- default:
- return *new(TemperatureUnit), errors.New(fmt.Sprintf("invalid unit: '%s'", s))
- }
-}
-
type Temperature struct {
Val float32
Unit TemperatureUnit