Skip to content

Commit 3c3ffe0

Browse files
committed
Changed constructor to get client
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent c00e058 commit 3c3ffe0

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

Diff for: .idea/workspace.xml

+2-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: client.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ type (
1111
}
1212

1313
Error struct {
14-
Code int `json:"code"`
15-
Message string `json:"message"`
14+
StatusCode int `json:"status_code"`
15+
Code int `json:"code"`
16+
Message string `json:"message"`
1617
}
1718
)
1819

1920
const (
2021
url = "https://api.labstack.com"
2122
)
2223

23-
func New(key string) *Client {
24+
func NewClient(key string) *Client {
2425
return &Client{
2526
key: key,
2627
resty: resty.New().SetHostURL(url).SetAuthToken(key),

Diff for: client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package labstack
33
import "os"
44

55
var (
6-
client = New(os.Getenv("KEY"))
6+
client = NewClient(os.Getenv("KEY"))
77
cs = client.Currency()
88
ds = client.Domain()
99
es = client.Email()

0 commit comments

Comments
 (0)