Skip to content

Commit

Permalink
Merge pull request #65 from showwin/fix/conflict
Browse files Browse the repository at this point in the history
fix conflict from #62 and #63
  • Loading branch information
showwin authored Feb 20, 2022
2 parents 338c9e0 + dc761f5 commit db677c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions speedtest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const (
XMLPayload
)


// Server information
type Server struct {
URL string `xml:"url,attr" json:"url"`
Expand Down Expand Up @@ -76,7 +75,7 @@ func (client *Speedtest) FetchServers(user *User) (Servers, error) {
return client.FetchServerListContext(context.Background(), user)
}

// FetchServerList retrieves a list of available servers
// FetchServers retrieves a list of available servers
func FetchServers(user *User) (Servers, error) {
return defaultClient.FetchServers(user)
}
Expand Down Expand Up @@ -131,13 +130,14 @@ func (client *Speedtest) FetchServerListContext(ctx context.Context, user *User)
if err := decoder.Decode(&list); err != nil {
return servers, err
}

servers = list.Servers
default:
return servers, fmt.Errorf("response payload decoding not implemented")
}

// set doer of server
for _, s := range list.Servers {
for _, s := range servers {
s.doer = client.doer
}

Expand All @@ -161,7 +161,7 @@ func (client *Speedtest) FetchServerListContext(ctx context.Context, user *User)
}

// FetchServerListContext retrieves a list of available servers, observing the given context.
func FetchServerListContext(ctx context.Context, user *User) (ServerList, error) {
func FetchServerListContext(ctx context.Context, user *User) (Servers, error) {
return defaultClient.FetchServerListContext(ctx, user)
}

Expand Down

0 comments on commit db677c8

Please sign in to comment.