trapped / jsonchan

Stream interface channels as JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonchan

GoDoc

jsonchan streams JSON from a chan interface{} sink. It has no external dependencies.

Install with go get -u github.com/trapped/jsonchan.

Usage

c := make(chan interface{}, 0)
go func() {
	n := 0
	for n < 10 {
		c <- n
	}
	close(c)
}
jsonchan.Stream(os.Stdout, c)

About

Stream interface channels as JSON

License:MIT License


Languages

Language:Go 100.0%