aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modfetch/codehost/git.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-06-24 12:29:28 -0400
committerBryan C. Mills <bcmills@google.com>2019-06-25 13:27:07 +0000
commite28f0d92991e60ac3174b2ebf224f37be22c8fad (patch)
tree60314d8f8f87ad0ad415ea1a71f21b12abaf313a /src/cmd/go/internal/modfetch/codehost/git.go
parentdf901bce5ed71132f5837b513663fec889d82731 (diff)
downloadgo-e28f0d92991e60ac3174b2ebf224f37be22c8fad.tar.gz
go-e28f0d92991e60ac3174b2ebf224f37be22c8fad.zip
cmd/go/internal/modfetch: return structured errors from proxy operations
CL 181881 added structured error types for direct fetches. Use those same structured errors to format proxy errors consistently. Also ensure that an empty @v/list is treated as equivalent to the module not existing at all. Updates #27173 Updates #32715 Change-Id: I203fd8259bc4f28b3389745f1a1fde936b0fa24d Reviewed-on: https://go-review.googlesource.com/c/go/+/183619 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modfetch/codehost/git.go')
-rw-r--r--src/cmd/go/internal/modfetch/codehost/git.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go
index 83e694dfe8..d382e8ac9a 100644
--- a/src/cmd/go/internal/modfetch/codehost/git.go
+++ b/src/cmd/go/internal/modfetch/codehost/git.go
@@ -222,7 +222,7 @@ func (r *gitRepo) Latest() (*RevInfo, error) {
return nil, r.refsErr
}
if r.refs["HEAD"] == "" {
- return nil, fmt.Errorf("no commits")
+ return nil, ErrNoCommits
}
return r.Stat(r.refs["HEAD"])
}