Using the Go SDK to stream container logs - possible?

Hi, I’m writing a tool for some game server software in Go called sampctl and the primary function is to spin up a Docker container for a server instance and then capture the logs coming out of the container, clean them up a bit and send them to a location of the users choice such as Elasticsearch or an administration panel for later analysis.

I’ve got everything else working, the only thing I can’t seem to get to work is streaming logs. I can get logs if the application in the container crashes but I want to stream the logs in realtime.

I’ve tried using a scanner with the ContainerLogs returned ReadCloser but that just hung at the terminal.

https://github.com/Southclaws/sampctl/blob/master/run_container.go#L64

Does ContainerLogs even support streaming? Or will I need to figure out another solution…

Apologies if this is more of a Go question than a Docker question, I wasn’t too sure whether or not to post here or on GoLangBridge…