maint: clean up some errors
This commit is contained in:
parent
de4e37ed75
commit
2f19fa792f
4 changed files with 5 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
package delete
|
package delete
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ func deleteRun(opts *DeleteOptions) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if username != gist.Owner.Login {
|
if username != gist.Owner.Login {
|
||||||
return fmt.Errorf("You do not own this gist.")
|
return errors.New("you do not own this gist")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = deleteGist(apiClient, host, gistID)
|
err = deleteGist(apiClient, host, gistID)
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ func Test_deleteRun(t *testing.T) {
|
||||||
Owner: &shared.GistOwner{Login: "octocat2"},
|
Owner: &shared.GistOwner{Login: "octocat2"},
|
||||||
},
|
},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
wantStderr: "You do not own this gist.",
|
wantStderr: "you do not own this gist",
|
||||||
}, {
|
}, {
|
||||||
name: "successfully delete",
|
name: "successfully delete",
|
||||||
gist: &shared.Gist{
|
gist: &shared.Gist{
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ func editRun(opts *EditOptions) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if username != gist.Owner.Login {
|
if username != gist.Owner.Login {
|
||||||
return fmt.Errorf("You do not own this gist.")
|
return errors.New("you do not own this gist")
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdate := false
|
shouldUpdate := false
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ func Test_editRun(t *testing.T) {
|
||||||
},
|
},
|
||||||
Owner: &shared.GistOwner{Login: "octocat2"},
|
Owner: &shared.GistOwner{Login: "octocat2"},
|
||||||
},
|
},
|
||||||
wantErr: "You do not own this gist.",
|
wantErr: "you do not own this gist",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "add file to existing gist",
|
name: "add file to existing gist",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue