Created
January 22, 2020 06:34
-
-
Save hbd/add00d528296a264f409a79ea0bf44e7 to your computer and use it in GitHub Desktop.
Writing Clients in Go: Redundancy and the `*iface` Package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bing | |
func (c *Client) DriveTime(ctx context.Context, locations ...Location) (float64, error) { | |
// Call external API. | |
driveTime, err := c.httpclient.Post(ctx, c.config.Endpoint+"/routing/time", ...) | |
... | |
return driveTime, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment