We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b0958e + 8e09786 commit d5b5f75Copy full SHA for d5b5f75
pkg/stripper/comments_example_test.go
@@ -0,0 +1,31 @@
1
+package stripper_test
2
+
3
+import (
4
+ "io"
5
+ "os"
6
+ "strings"
7
8
+ "github.com/docker-library/go-dockerlibrary/pkg/stripper"
9
+)
10
11
+func ExampleCommentStripper() {
12
+ r := strings.NewReader(`
13
+# opening comment
14
+a: b
15
+# comment!
16
+c: d # not a comment
17
18
+# another cheeky comment
19
+e: f
20
+`)
21
22
+ comStrip := stripper.NewCommentStripper(r)
23
24
+ io.Copy(os.Stdout, comStrip)
25
26
+ // Output:
27
+ // a: b
28
+ // c: d # not a comment
29
+ //
30
+ // e: f
31
+}
0 commit comments