diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-02-08 01:34:40 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-02-08 01:34:40 -0500 |
| commit | 983baf5a0bd7e1ff8bfa6245e7fdd1b279cba21f (patch) | |
| tree | 2b2e6a4d0c2f282a11b2a99395b19e7da6ee55d4 | |
| parent | d0808b329d7f2b5e723fb3e1289d80e166ea342f (diff) | |
| download | volute-983baf5a0bd7e1ff8bfa6245e7fdd1b279cba21f.zip | |
remove dead code from temperature.go
| -rw-r--r-- | temperature.go | 21 |
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 |