bug in error handling

This commit is contained in:
Ulrich Schreiner
2015-02-06 12:05:39 +01:00
parent 7b02878df9
commit d3b337ff30

View File

@@ -243,12 +243,12 @@ func GetKeyTitle(rawurl string) (string, error) {
// DeleteKey is a helper function that deletes a deploy key // DeleteKey is a helper function that deletes a deploy key
// for the specified repository. // for the specified repository.
func DeleteKey(client *github.Client, owner, name, title, key string) error { func DeleteKey(client *github.Client, owner, name, title, key string) error {
var k, _ = GetKey(client, owner, name, title) var k, err = GetKey(client, owner, name, title)
if k != nil { if err != nil {
_, err := client.Repositories.DeleteKey(owner, name, *k.ID)
return err return err
} }
return nil _, err = client.Repositories.DeleteKey(owner, name, *k.ID)
return err
} }
// CreateKey is a helper function that creates a deploy key // CreateKey is a helper function that creates a deploy key