Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Fix time in rest api #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions service_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ func (as *apiService) Time() (time.Time, error) {
}
defer res.Body.Close()
var rawTime struct {
ServerTime string `json:"serverTime"`
ServerTime float64 `json:"serverTime"`
}
if err := json.Unmarshal(textRes, &rawTime); err != nil {
return time.Time{}, errors.Wrap(err, "timeResponse unmarshal failed")
}
t, err := timeFromUnixTimestampFloat(rawTime)
t, err := timeFromUnixTimestampFloat(rawTime.ServerTime)
if err != nil {
return time.Time{}, err
}
Expand Down