Skip to content

Commit

Permalink
cleanup adcode parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Oct 12, 2021
1 parent e432ec2 commit c7308e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backends/caiyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ func (c *CaiyunConfig) Fetch(location string, numdays int) iface.Data {
} else {
res.Current.Code = iface.CodeUnknown
}
if len(weatherData.Result.Alert.Adcodes) != 0 {
adcodes := weatherData.Result.Alert.Adcodes
if adcodes := weatherData.Result.Alert.Adcodes; len(adcodes) != 0 {
if len(adcodes) == 3 {
res.Location = adcodes[1].Name + adcodes[2].Name
}
Expand Down

0 comments on commit c7308e9

Please sign in to comment.