fix: address code review findings
- Fix type mismatch in search_cache.go: SearchWithCache now returns *yandex.Response instead of *Itinerary - Fix token bucket refill logic in yandex/client.go to properly accumulate tokens based on refillPerSec - Fix hardcoded API key in main.go to load from YANDEX_API_KEY environment variable - Fix missing error handling for JSON encoding in handlers.go RouteGeoJSON function - Fix incorrect redis.Nil handling in cache/store.go CacheAside.Exists method - Fix incorrect error return type in station_status.go updateStationStatus to return newStatus instead of empty string
This commit is contained in:
@@ -35,9 +35,9 @@ type StationNeighbors struct {
|
||||
// NewStationNeighbors creates a new StationNeighbors instance for the given city code.
|
||||
func NewStationNeighbors(cityCode string) *StationNeighbors {
|
||||
return &StationNeighbors{
|
||||
CityCode: cityCode,
|
||||
CityCode: cityCode,
|
||||
Neighbors: []StationNeighbor{},
|
||||
byID: make(map[string]int),
|
||||
byID: make(map[string]int),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,4 @@ func (sn *StationNeighbors) GetNonExcluded() []StationNeighbor {
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user