File tree Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Original file line number Diff line number Diff line change 1
- // +build ignore
2
-
3
- package main
1
+ package manifest_test
4
2
5
3
import (
6
4
"bufio"
@@ -10,8 +8,7 @@ import (
10
8
"github.com/docker-library/go-dockerlibrary/manifest"
11
9
)
12
10
13
- func main () {
14
- // TODO comment parsing
11
+ func Example () {
15
12
man , err := manifest .Parse (bufio .NewReader (strings .NewReader (`# RFC 2822
16
13
17
14
# I LOVE CAKE
@@ -76,4 +73,49 @@ i: g@h j
76
73
panic (err )
77
74
}
78
75
fmt .Printf ("-------------\n line-based:\n %v\n " , man )
76
+
77
+ // Output:
78
+ // -------------
79
+ // 2822:
80
+ // Maintainers: InfoSiftr <[email protected] > (@infosiftr), Johan Euphrosine <[email protected] > (@proppy)
81
+ // SharedTags: latest
82
+ // GitRepo: https://github.com/docker-library/golang.git
83
+ //
84
+ // Tags: 1.6.1, 1.6, 1
85
+ // GitCommit: 0ce80411b9f41e9c3a21fc0a1bffba6ae761825a
86
+ // Directory: 1.6
87
+ //
88
+ // Tags: 1.5.3, 1.5
89
+ // SharedTags: latest, 1.5.3-debian, 1.5-debian
90
+ // GitCommit: d7e2a8d90a9b8f5dfd5bcd428e0c33b68c40cc19
91
+ // Directory: 1.5
92
+ //
93
+ // Shared Tag Groups:
94
+ //
95
+ // - latest
96
+ // - 1.6.1, 1.6, 1
97
+ // - 1.5.3, 1.5
98
+ //
99
+ // - 1.5.3-debian, 1.5-debian
100
+ // - 1.5.3, 1.5
101
+ //
102
+ // -------------
103
+ // line-based:
104
+ // GitFetch: refs/heads/*
105
+ //
106
+ // Tags: a, e
107
+ // GitRepo: b
108
+ // GitCommit: c
109
+ // Directory: d
110
+ //
111
+ // Tags: f
112
+ // GitRepo: g
113
+ // GitFetch: refs/tags/h
114
+ // GitCommit: FETCH_HEAD
115
+ //
116
+ // Tags: i
117
+ // GitRepo: g
118
+ // GitFetch: refs/tags/h
119
+ // GitCommit: FETCH_HEAD
120
+ // Directory: j
79
121
}
You can’t perform that action at this time.
0 commit comments