Skip to content

Instantly share code, notes, and snippets.

@sbenthall
Created November 10, 2016 23:06
Show Gist options
  • Save sbenthall/d56f95433dea614c40e593f685b1bcc8 to your computer and use it in GitHub Desktop.
Save sbenthall/d56f95433dea614c40e593f685b1bcc8 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"gopkg.in/src-d/go-git.v4"
)
func main() {
r, _ := git.NewFilesystemRepository(".git")
_ = r.Clone(&git.CloneOptions{URL: "https://github.com/git-fixtures/tags"})
tags, _ := r.Tags()
tags.ForEach(func(t *git.Tag) error {
fmt.Println(t.ID(), t.Name)
return nil
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment