diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-04-09 03:52:39 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-04-09 03:53:24 +0200 |
commit | 2baec97b67834237c66f8fdabcad062812cd090f (patch) | |
tree | cb3dc109d1ec512e0e6e19a92907b8b8bc279ce0 | |
parent | b85fd5d29e087320c771613e89b6a7ecf4b3b7ff (diff) |
golint backends
-rw-r--r-- | backends/forecast.io.go | 8 | ||||
-rw-r--r-- | backends/worldweatheronline.com.go | 11 |
2 files changed, 11 insertions, 8 deletions
diff --git a/backends/forecast.io.go b/backends/forecast.io.go index 1fa7ad0..00b77d8 100644 --- a/backends/forecast.io.go +++ b/backends/forecast.io.go @@ -117,17 +117,17 @@ func (c *forecastConfig) parseCond(dp forecastDataPoint) (ret iface.Cond, err er ret.FeelsLikeC = dp.ApparentTemperature if dp.PrecipProbability != nil { - var p int = int(*dp.PrecipProbability * 100) + p := int(*dp.PrecipProbability * 100) ret.ChanceOfRainPercent = &p } if dp.PrecipIntensity != nil && *dp.PrecipIntensity >= 0 { - var p float32 = *dp.PrecipIntensity / 1000 + p := *dp.PrecipIntensity / 1000 ret.PrecipM = &p } if dp.Visibility != nil && *dp.Visibility >= 0 { - var p float32 = *dp.Visibility * 1000 + p := *dp.Visibility * 1000 ret.VisibleDistM = &p } @@ -138,7 +138,7 @@ func (c *forecastConfig) parseCond(dp forecastDataPoint) (ret iface.Cond, err er //ret.WindGustKmph not provided by forecast.io :( if dp.WindBearing != nil && *dp.WindBearing >= 0 { - var p int = int(*dp.WindBearing) % 360 + p := int(*dp.WindBearing) % 360 ret.WinddirDegree = &p } diff --git a/backends/worldweatheronline.com.go b/backends/worldweatheronline.com.go index eb29cc5..1208c5c 100644 --- a/backends/worldweatheronline.com.go +++ b/backends/worldweatheronline.com.go @@ -2,7 +2,6 @@ package backends import ( "bytes" - _ "crypto/sha512" "encoding/json" "flag" "io/ioutil" @@ -13,6 +12,10 @@ import ( "strings" "time" + // needed for some go versions <1.4.2. TODO: Remove this import when golang + // v1.4.2 or later is in debian stable and the latest Ubuntu LTS release. + _ "crypto/sha512" + "github.com/schachmat/wego/iface" ) @@ -145,7 +148,7 @@ func wwoParseCond(cond wwoCond, date time.Time) (ret iface.Cond) { ret.FeelsLikeC = cond.FeelsLikeC if cond.PrecipMM != nil { - var p float32 = *cond.PrecipMM / 1000 + p := *cond.PrecipMM / 1000 ret.PrecipM = &p } @@ -157,12 +160,12 @@ func wwoParseCond(cond wwoCond, date time.Time) (ret iface.Cond) { } if cond.VisibleDistKM != nil { - var p float32 = *cond.VisibleDistKM * 1000 + p := *cond.VisibleDistKM * 1000 ret.VisibleDistM = &p } if cond.WinddirDegree != nil && *cond.WinddirDegree >= 0 { - var p int = *cond.WinddirDegree % 360 + p := *cond.WinddirDegree % 360 ret.WinddirDegree = &p } |