Skip to content

Commit

Permalink
zip: fix doc for CreateFromVCS function
Browse files Browse the repository at this point in the history
CreateFromVCS returns UnrecognizedVCSError.

Change-Id: I54e9be4c44eb889657c581a34d38987042be9ad2
Reviewed-on: https://go-review.googlesource.com/c/mod/+/502435
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
  • Loading branch information
alexandear authored and gopherbot committed Jun 16, 2023
1 parent bfed713 commit 22d21f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zip/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func CreateFromDir(w io.Writer, m module.Version, dir string) (err error) {
// "sub/dir". To create a zip from the base of the repository, pass an empty
// string.
//
// If CreateFromVCS returns ErrUnrecognizedVCS, consider falling back to
// If CreateFromVCS returns UnrecognizedVCSError, consider falling back to
// CreateFromDir.
func CreateFromVCS(w io.Writer, m module.Version, repoRoot, revision, subdir string) (err error) {
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion zip/zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ var A = 5
}
var gotErr *modzip.UnrecognizedVCSError
if !errors.As(err, &gotErr) {
t.Errorf("CreateFromVCS: returned error does not unwrap to modzip.ErrUnrecognisedVCS, but expected it to. returned error: %v", err)
t.Errorf("CreateFromVCS: returned error does not unwrap to modzip.UnrecognizedVCSError, but expected it to. returned error: %v", err)
} else if gotErr.RepoRoot != tmpDir {
t.Errorf("CreateFromVCS: returned error has RepoRoot %q, but want %q. returned error: %v", gotErr.RepoRoot, tmpDir, err)
}
Expand Down

0 comments on commit 22d21f4

Please sign in to comment.