func TestOrZeroReturnsNoneOnNil(t *testing.T) { if v := credentials.OrZero(nil); v != credentials.None { t.Errorf("credentials.OrZero(nil) should've returned credentials.None, not %v!", v) } }
// New creates a new Nexus client, using the default Client implementation. func New(url string, c credentials.Credentials) Client { return &Nexus2x{ URL: url, Credentials: credentials.OrZero(c), HTTPClient: &http.Client{}} }
func TestOrZeroReturnsTheGivenNonNilArgument(t *testing.T) { c := credentials.BasicAuth("", "") if v := credentials.OrZero(c); v != c { t.Errorf("credentials.OrZero(%v) should've returned %v, not %v!", c, c, v) } }