40 lines
646 B
Go
40 lines
646 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
git "go.wit.com/lib/libgit2"
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
// are sent via -ldflags at buildtime
|
|
var VERSION string
|
|
var BUILDTIME string
|
|
|
|
func main() {
|
|
if argv.Refs {
|
|
showRefs()
|
|
} else {
|
|
testMessage()
|
|
}
|
|
}
|
|
|
|
func showRefs() {
|
|
log.Info("how do you do this with libgit2 and git2go? notsure.")
|
|
}
|
|
|
|
func testMessage() {
|
|
var input git.Trailer
|
|
|
|
input.Key = "Co-authored-by"
|
|
input.Value = "Alice <alice@example.com>"
|
|
/*
|
|
git2go.Trailer
|
|
git2go.Trailer{Key: "Signed-off-by", Value: "Bob <bob@example.com>"}}
|
|
*/
|
|
|
|
fmt.Printf("%s", input)
|
|
actual, err := git.MessageTrailers(input.Key)
|
|
log.Info("actual", actual, err)
|
|
}
|