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.
- Host: GitHub
- URL: https://github.com/timob/commentfilter
- Owner: timob
- License: bsd-2-clause
- Created: 2014-08-02T15:07:28.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-03-27T15:11:45.000Z (about 10 years ago)
- Last Synced: 2024-06-20T06:30:25.535Z (almost 2 years ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
}
```