Skip to content

Commit 4d81eb7

Browse files
committed
reformat types
1 parent 574683f commit 4d81eb7

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var err error
2323
currentWeather, err = owm.CurrentWeatherFromCity(city)
2424
```
2525

26-
If fetching the weather from geocoordinates, pass the latitude and longitudeas arguments to the CurrentWeatherFromCoordinates function
26+
If fetching the weather from geocoordinates, pass the latitude and longitudes arguments to the CurrentWeatherFromCoordinates function
2727
```go
2828
var currentWeather *openweathermap.CurrentWeatherResponse
2929
var err error

‎openweathermap.go‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@ type Rain struct {
4545
Threehr int `json:"3h"`
4646
}
4747

48-
type Visibility string
49-
50-
type Dt int
51-
52-
type Id int
53-
54-
type Name string
55-
56-
type Country string
57-
5848
type Main struct {
5949
Temp float64 `json:"temp"`
6050
Pressure int `json:"pressure"`
@@ -74,17 +64,17 @@ type CurrentWeatherResponse struct {
7464
Wind `json:"wind"`
7565
Rain `json:"rain"`
7666
Clouds `json:"clouds"`
77-
Dt `json:"dt"`
78-
Id `json:"id"`
79-
Name `json:"name"`
67+
Dt int `json:"dt"`
68+
Id int `json:"id"`
69+
Name string `json:"name"`
8070
}
8171

8272
type ForecastResponse struct {
8373
City `json:"city"`
8474
Coord `json:"coord"`
85-
Country `json:"country"`
75+
Country string `json:"country"`
8676
List [] struct {
87-
Dt `json:"dt"`
77+
Dt int `json:"dt"`
8878
Main `json:"main"`
8979
Weather `json:"weather"`
9080
Clouds `json:"clouds"`
@@ -165,3 +155,5 @@ func (owm *OpenWeatherMap) CurrentWeatherFromCoordinates(lat, long float64) (*Cu
165155
return &cwr, nil
166156
}
167157

158+
159+

0 commit comments

Comments
 (0)