Conditions | 4 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package devto |
||
35 | func NewClient(ctx context.Context, conf *Config, bc httpClient) (dev *Client, err error) { |
||
36 | if bc == nil { |
||
37 | bc = http.DefaultClient |
||
38 | } |
||
39 | |||
40 | if ctx == nil { |
||
41 | ctx = context.Background() |
||
42 | } |
||
43 | |||
44 | if conf == nil { |
||
45 | return nil, ErrMissingConfig |
||
46 | } |
||
47 | |||
48 | return &Client{ |
||
49 | Context: ctx, |
||
50 | HTTPClient: bc, |
||
51 | Config: conf, |
||
52 | }, nil |
||
53 | } |
||
54 |