32 lines
403 B
Go
32 lines
403 B
Go
package stripper_test
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
|
|
)
|
|
|
|
func ExampleCommentStripper() {
|
|
r := strings.NewReader(`
|
|
# opening comment
|
|
a: b
|
|
# comment!
|
|
c: d # not a comment
|
|
|
|
# another cheeky comment
|
|
e: f
|
|
`)
|
|
|
|
comStrip := stripper.NewCommentStripper(r)
|
|
|
|
io.Copy(os.Stdout, comStrip)
|
|
|
|
// Output:
|
|
// a: b
|
|
// c: d # not a comment
|
|
//
|
|
// e: f
|
|
}
|