diff options
author | Carlos Cobo <toqueteos@gmail.com> | 2015-10-15 17:52:19 +0200 |
---|---|---|
committer | Carlos Cobo <toqueteos@gmail.com> | 2015-10-15 17:52:19 +0200 |
commit | 5f5ad88bf2babe506f927d64d2b7a1e1493dc2ae (patch) | |
tree | a79a04e39b98bed8d6c7fb753e3fd9548068d8fe | |
parent | a2014124ca3b3f9ff28fbab0a83ce3c71bf4622e (diff) | |
download | go-git-5f5ad88bf2babe506f927d64d2b7a1e1493dc2ae.tar.gz |
Remove duplicate NotFoundError and rename it to ErrNotFound (idiomatic)
Error had to be defined in its own package to avoid import cycles.
-rw-r--r-- | client.go | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -7,6 +7,7 @@ import ( "net/url" "strings" + "github.com/tyba/srcd-crawler/clients/common" "github.com/tyba/srcd-crawler/clients/git/pktline" "github.com/sourcegraph/go-vcsurl" @@ -35,7 +36,7 @@ func (c *Client) Refs() (*Refs, error) { } if res.StatusCode >= 400 { - return nil, &NotFoundError{c.url} + return nil, &common.ErrNotFound{c.url} } defer res.Body.Close() @@ -150,14 +151,6 @@ func (c *Client) applyHeadersToRequest(req *http.Request, content *strings.Reade } } -type NotFoundError struct { - url string -} - -func (e NotFoundError) Error() string { - return e.url -} - type Refs struct { defaultBranch string branches map[string]string |