mirror of
https://github.com/blindlobstar/go-interview-problems
synced 2025-04-26 11:45:15 +00:00
17 lines
378 B
Go
17 lines
378 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Getter interface {
|
|
Get(ctx context.Context, address, key string) (string, error)
|
|
}
|
|
|
|
// Call `Getter.Get()` for each address in parallel.
|
|
// Returns the first successful response.
|
|
// If all requests fail, returns an error.
|
|
func Get(ctx context.Context, getter Getter, addresses []string, key string) (string, error) {
|
|
return "", nil
|
|
}
|