func main() { … } type jsonLog … // jsonToRawLog converts a single line of json formatted log to raw log. // If there is an error, it returns the original input. func jsonToRawLog(line string) (string, error) { … } func extractRawLog(r io.Reader) error { … }