Skip to content

Instantly share code, notes, and snippets.

View jayachandranb's full-sized avatar

Jayachandran Balachandran jayachandranb

  • Melbourne, Australia
View GitHub Profile
@jayachandranb
jayachandranb / SSHwithgit2go.go
Created March 18, 2018 13:52 — forked from zchee/SSHwithgit2go.go
Working example with SSH and libgit2/git2go
package main
import (
git "github.com/libgit2/git2go"
"log"
)
func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) {
ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "")
return git.ErrorCode(ret), &cred