Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentStripper ¶
type CommentStripper struct {
Comment string
Delimiter byte
Whitespace bool
// contains filtered or unexported fields
}
Example ¶
package main
import (
"io"
"os"
"strings"
"github.com/docker-library/bashbrew/pkg/stripper"
)
func main() {
r := strings.NewReader(`
# opening comment
a: b
# comment!
c: d # not a comment
# another cheeky comment
e: f
`)
comStrip := stripper.NewCommentStripper(r)
// using CopyBuffer to force smaller Read sizes (better testing coverage that way)
io.CopyBuffer(os.Stdout, comStrip, make([]byte, 32))
}
Output: a: b c: d # not a comment e: f
func NewCommentStripper ¶
func NewCommentStripper(r io.Reader) *CommentStripper
Click to show internal directories.
Click to hide internal directories.