forked from TrueCloudLab/frostfs-node
[#625] morph/client: make all constructors return no error
In some places we panic, in some we return error, in some (audit) just return a client. However in all of the places static client is created immediately before the sugared-client creation. This commit makes all constructors to just return a client for the sake of code simplification and unification. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
3c5b62d839
commit
0decb95591
11 changed files with 12 additions and 73 deletions
|
@ -24,14 +24,8 @@ const (
|
|||
)
|
||||
|
||||
// New creates, initializes and returns the Client instance.
|
||||
//
|
||||
// If StaticClient is nil, client.ErrNilStaticClient is returned.
|
||||
func New(c *client.StaticClient) (*Client, error) {
|
||||
if c == nil {
|
||||
return nil, client.ErrNilStaticClient
|
||||
}
|
||||
|
||||
return &Client{client: c}, nil
|
||||
func New(c *client.StaticClient) *Client {
|
||||
return &Client{client: c}
|
||||
}
|
||||
|
||||
// Morph returns raw morph client.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue