MCPcopy Index your code
hub / github.com/go-git/go-git / ExampleSigner

Function ExampleSigner

signer_test.go:28–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28func ExampleSigner() {
29 repo, err := Init(memory.NewStorage(), memfs.New())
30 if err != nil {
31 panic(err)
32 }
33 w, err := repo.Worktree()
34 if err != nil {
35 panic(err)
36 }
37 commit, err := w.Commit("example commit", &CommitOptions{
38 Author: &object.Signature{
39 Name: "John Doe",
40 Email: "john@example.com",
41 When: time.UnixMicro(1234567890).UTC(),
42 },
43 Signer: b64signer{},
44 AllowEmptyCommits: true,
45 })
46 if err != nil {
47 panic(err)
48 }
49
50 obj, err := repo.CommitObject(commit)
51 if err != nil {
52 panic(err)
53 }
54 fmt.Println(obj.PGPSignature)
55 // Output: dHJlZSA0YjgyNWRjNjQyY2I2ZWI5YTA2MGU1NGJmOGQ2OTI4OGZiZWU0OTA0CmF1dGhvciBKb2huIERvZSA8am9obkBleGFtcGxlLmNvbT4gMTIzNCArMDAwMApjb21taXR0ZXIgSm9obiBEb2UgPGpvaG5AZXhhbXBsZS5jb20+IDEyMzQgKzAwMDAKCmV4YW1wbGUgY29tbWl0
56}

Callers

nothing calls this directly

Calls 5

NewStorageFunction · 0.92
InitFunction · 0.85
WorktreeMethod · 0.80
CommitObjectMethod · 0.80
CommitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…