Skip to content

Commit

Permalink
golint backends
Browse files Browse the repository at this point in the history
  • Loading branch information
schachmat committed Apr 9, 2016
1 parent b85fd5d commit 2baec97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions backends/forecast.io.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
11 changes: 7 additions & 4 deletions backends/worldweatheronline.com.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package backends

import (
"bytes"
_ "crypto/sha512"
"encoding/json"
"flag"
"io/ioutil"
Expand All @@ -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"
)

Expand Down Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 2baec97

Please sign in to comment.