Skip to content

Commit 02a23d8

Browse files
committed
Increase coverage further by adding an example for "manifest.Fetch"
1 parent 6355cdb commit 02a23d8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

manifest/example_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,24 @@ i: g@h j
125125
// GitCommit: FETCH_HEAD
126126
// Directory: j
127127
}
128+
129+
func ExampleFetch() {
130+
repoName, tagName, man, err := manifest.Fetch("/home/jsmith/docker/official-images/library", "https://github.com/docker-library/official-images/raw/1a3c4cd6d5cd53bd538a6f56a69f94c5b35325a7/library/bash:4.4")
131+
if err != nil {
132+
panic(err)
133+
}
134+
135+
fmt.Printf("%s:%s\n\n", repoName, tagName)
136+
137+
fmt.Println(man.GetTag(tagName))
138+
139+
// Output:
140+
// bash:4.4
141+
//
142+
// Maintainers: Tianon Gravi <[email protected]> (@tianon)
143+
// Tags: 4.4.12, 4.4, 4, latest
144+
// GitRepo: https://github.com/tianon/docker-bash.git
145+
// GitFetch: refs/heads/master
146+
// GitCommit: 1cbb5cf49b4c53bd5a986abf7a1afeb9a80eac1e
147+
// Directory: 4.4
148+
}

0 commit comments

Comments
 (0)