An open API service indexing awesome lists of open source software.

https://github.com/timob/commentfilter

Go io.Reader that filters out comments.
https://github.com/timob/commentfilter

Last synced: 5 months ago
JSON representation

Go io.Reader that filters out comments.

Awesome Lists containing this project

README

          

commentfilter
==========
Go package to provide a io.Reader that filters out comments.

Example
-------
```Go
package main

import (
"bytes"
"github.com/timob/commentfilter"
"io"
"os"
)

func main() {
source := bytes.NewBufferString(
`" /* here is a string literal */ \" " /* Here is a "comment" */ `,
)
filtered := commentfilter.NewCommentFilter("/*", "*/", `"`, `\`, source)
io.Copy(os.Stdout, filtered)
}
```