()
| 26 | } |
| 27 | |
| 28 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…