diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-12 15:50:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 15:50:03 +0100 |
commit | 3967812bd0de40330dfbb9e1a7d14d4073cc1b10 (patch) | |
tree | dbd5df2a66bdd50df40fd773e1d1ec284483ecfe /examples/latest | |
parent | 6f701ecc18909959364b708b8efddd03cf4e809c (diff) | |
download | go-git-3967812bd0de40330dfbb9e1a7d14d4073cc1b10.tar.gz |
examples: review, testing and documentation (#176)
* examples reviews, testing and documentation
* including the execution on travis, and fix readme
* fix example link
* including the execution on travis
Diffstat (limited to 'examples/latest')
-rw-r--r-- | examples/latest/latest.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/examples/latest/latest.go b/examples/latest/latest.go deleted file mode 100644 index 05f583a..0000000 --- a/examples/latest/latest.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "gopkg.in/src-d/go-git.v4" -) - -func main() { - url := os.Args[1] - - fmt.Printf("Retrieving latest commit from: %q ...\n", url) - r := git.NewMemoryRepository() - - if err := r.Clone(&git.CloneOptions{URL: url}); err != nil { - panic(err) - } - - head, err := r.Head() - if err != nil { - panic(err) - } - - commit, err := r.Commit(head.Hash()) - if err != nil { - panic(err) - } - - fmt.Println(commit) -} |