From 5def02a589a2c1653f4bb515fdec290361a222be Mon Sep 17 00:00:00 2001 From: lhchavez Date: Tue, 1 Dec 2020 19:11:41 -0800 Subject: The big Callback type adjustment of 2020 This change makes all callbacks that can fail return an `error`. This makes things a lot more idiomatic. --- clone_test.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'clone_test.go') diff --git a/clone_test.go b/clone_test.go index acfbbcb..8814dd0 100644 --- a/clone_test.go +++ b/clone_test.go @@ -49,15 +49,9 @@ func TestCloneWithCallback(t *testing.T) { opts := CloneOptions{ Bare: true, - RemoteCreateCallback: func(r *Repository, name, url string) (*Remote, ErrorCode) { + RemoteCreateCallback: func(r *Repository, name, url string) (*Remote, error) { testPayload += 1 - - remote, err := r.Remotes.Create(REMOTENAME, url) - if err != nil { - return nil, ErrorCodeGeneric - } - - return remote, ErrorCodeOK + return r.Remotes.Create(REMOTENAME, url) }, } -- cgit v1.2.3