MCPcopy
hub / github.com/perkeep/perkeep / NewOrFail

Function NewOrFail

pkg/client/client.go:219–225  ·  view source on GitHub ↗

NewOrFail is like New, but calls log.Fatal instead of returning an error.

(opts ...ClientOption)

Source from the content-addressed store, hash-verified

217
218// NewOrFail is like New, but calls log.Fatal instead of returning an error.
219func NewOrFail(opts ...ClientOption) *Client {
220 c, err := New(opts...)
221 if err != nil {
222 log.Fatalf("error creating client: %v", err)
223 }
224 return c
225}
226
227// NewPathClient returns a new client accessing a subpath of c.
228func (c *Client) NewPathClient(path string) (*Client, error) {

Callers 7

TestUploadFileFunction · 0.92
mainFunction · 0.92
newClientFunction · 0.92
newUploaderFunction · 0.92
mainFunction · 0.92
newClientFunction · 0.92

Calls 2

NewFunction · 0.70
FatalfMethod · 0.65

Tested by 1

TestUploadFileFunction · 0.74