Пример #1
0
func stripJSONComments(s []byte) ([]byte, error) {
	var out bytes.Buffer
	reader := bytes.NewBuffer(s)
	if err := jsonpreprocess.WriteCommentTrimmedTo(&out, reader); err != nil {
		return s, err
	}
	return out.Bytes(), nil
}
Пример #2
0
func main() {
	err := jsonpreprocess.WriteCommentTrimmedTo(os.Stdout, os.Stdin)
	if err != nil {
		panic(err)
	}
}