Skip to content

Commit

Permalink
Edit README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
osamingo committed May 5, 2021
1 parent 9cc30f6 commit 4da648e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Unofficially [kenall](https://kenall.jp/) (ケンオール) client written by Go
## Install

```shell
$ go get -u github.com/osamingo/go-kenall
$ go get github.com/osamingo/go-kenall@v1.2.0
```

## Usage
Expand All @@ -31,20 +31,26 @@ import (
)

func main() {

cli, err := kenall.NewClient(os.Getenv("KENALL_AUTHORIZATION_TOKEN"))
if err != nil {
log.Fatal(err)
}

res, err := cli.GetAddress(context.Background(), "1000001")
resAddr, err := cli.GetAddress(context.Background(), "1000001")
if err != nil {
log.Fatal(err)
}

addr := res.Addresses[0]
addr := resAddr.Addresses[0]
fmt.Println(addr.Prefecture, addr.City, addr.Town)
// Output: 東京都 千代田区 千代田

resCity, err := cli.GetCity(context.Background(), "13")
if err != nil {
log.Fatal(err)
}
city := resCity.Cities[0]
fmt.Println(city.Prefecture, city.City)
// Output: 東京都 千代田区
}
```

Expand Down

0 comments on commit 4da648e

Please sign in to comment.