Skip to content

Commit

Permalink
Now uses loraxipam/havers2
Browse files Browse the repository at this point in the history
  • Loading branch information
loraxipam committed Jul 1, 2020
1 parent 1a4b040 commit 4ea2ba7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ When you just want a quick peek at the local weather, here's a tool to query wea
## Dependencies

- github.com/loraxipam/compassrose
- github.com/loraxipam/haversine
- github.com/loraxipam/havers2

## Setup

Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/loraxipam/weatherstem-cli

go 1.14

require (
github.com/json-iterator/go v1.1.10
github.com/loraxipam/compassrose v0.0.0-20200519203256-18341d88b08c
github.com/loraxipam/havers2 v0.0.0-20200701194559-c3960ce57f89
)
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d h1:C/hKUcHT483btRbeGkrRjJz+Zbcj8audldIi9tRJDCc=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/loraxipam/compassrose v0.0.0-20200519203256-18341d88b08c h1:/doTrM1YqoLyXKRZSR5tFn0/R8WrDWI3FjaWVpLPM7s=
github.com/loraxipam/compassrose v0.0.0-20200519203256-18341d88b08c/go.mod h1:evhVbeiy4nDAifRqruHfwpcgUFqVrAgVsgPfvWRoPrc=
github.com/loraxipam/havers2 v0.0.0-20200701194559-c3960ce57f89 h1:N/U7CyJ4RvecRdHubADFTku+KDsJWgLz8v+bEectFWg=
github.com/loraxipam/havers2 v0.0.0-20200701194559-c3960ce57f89/go.mod h1:++Jy3Fm90K5IilXuPPWk0vvOfjjD7Zi0AFlSWM5JgtQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5 changes: 4 additions & 1 deletion weatherstem.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
json "github.com/json-iterator/go"

"github.com/loraxipam/compassrose"
"github.com/loraxipam/haversine"
haversine "github.com/loraxipam/havers2"

"fmt"
"io/ioutil"
Expand Down Expand Up @@ -176,6 +176,7 @@ func PopulateWeatherData(winfo *WeatherInfo, rose bool) (wdata WeatherData, wuni
wdata.Station[2] = winfo.WeatherRecord.ReadingsTimestamp
wdata.StationTopo.Lat, _ = strconv.ParseFloat(winfo.WeatherStation.Latitude, 64)
wdata.StationTopo.Lon, _ = strconv.ParseFloat(winfo.WeatherStation.Longitude, 64)
wdata.StationTopo.Calc()
wdata.StationDist = 2.4
wunits.Label = "units"
wunits.Station[0] = winfo.WeatherStation.Handle
Expand Down Expand Up @@ -307,6 +308,8 @@ func (config *configSettings) getConfigSettings(inputFile string) (err error) {
log.Panicf("Config version mismatch, %v should be %v\n", configVersion, configSettingsVersion)
}

config.Me.Calc()

return err
}

Expand Down

0 comments on commit 4ea2ba7

Please sign in to comment.