From 6b33126e79695b499d7d519f69db4ca1ebd22dd1 Mon Sep 17 00:00:00 2001 From: kuba-- Date: Wed, 18 Apr 2018 10:35:07 +0200 Subject: git: worktree, Skip special git directory. Fixes #814 Signed-off-by: kuba-- --- example_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'example_test.go') diff --git a/example_test.go b/example_test.go index e9d8e8b..ef7e3d3 100644 --- a/example_test.go +++ b/example_test.go @@ -24,12 +24,18 @@ func ExampleClone() { // Clones the repository into the worktree (fs) and storer all the .git // content into the storer - _, _ = git.Clone(storer, fs, &git.CloneOptions{ + _, err := git.Clone(storer, fs, &git.CloneOptions{ URL: "https://github.com/git-fixtures/basic.git", }) + if err != nil { + log.Fatal(err) + } // Prints the content of the CHANGELOG file from the cloned repository - changelog, _ := fs.Open("CHANGELOG") + changelog, err := fs.Open("CHANGELOG") + if err != nil { + log.Fatal(err) + } io.Copy(os.Stdout, changelog) // Output: Initial changelog -- cgit