This repository demonstrates how to use gostream.
Head over to the build file in order to see what has to be done. You'd just get your dependencies as usual, but in addition to that, you generate the specific versions of generic files that you want to use, you can also generate more of them at a later point in time or simply delete the existing ones to generate a new one with more types.
In this example I ceated a specific package for it, simply because I didn't want the file to be in the same package as my own code.
In order to execute this example locally, run the following commands:
- Get and install genny, but make sure your
$GOPATH/bin
is on the pathgo get -v -u github.com/cheekybits/genny go install github.com/cheekybits/genny
- Get the source
git clone https://github.com/Bios-Marcel/gostreamexample $GOPATH/src/github.com/Bios-Marcel/gostreamexample
- Generate the necessary code
cd $GOPATH/src/github.com/Bios-Marcel/gostreamexample go get -v -u github.com/Bios-Marcel/gostream genny -in="$GOPATH/src/github.com/Bios-Marcel/gostream/stream.go" -out="stream/stream.go" -pkg="stream" gen "GenericStreamEntity=string"
- Run the test
go run main.go