mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
18 lines
373 B
Go
Executable File
18 lines
373 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/postcode"
|
|
)
|
|
|
|
// Lookup a postcode to retrieve the related region, county, etc
|
|
func LookupPostcode() {
|
|
postcodeService := postcode.NewPostcodeService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := postcodeService.Lookup(&postcode.LookupRequest{
|
|
Postcode: "SW1A 2AA",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|