Skip to content

Instantly share code, notes, and snippets.

@joaolucasl
Last active November 6, 2016 02:49
Show Gist options
  • Save joaolucasl/3977e257d7d02882812670bb455b6eb5 to your computer and use it in GitHub Desktop.
Save joaolucasl/3977e257d7d02882812670bb455b6eb5 to your computer and use it in GitHub Desktop.
Go lang tail and print to terminal
package main
import (
"fmt"
"github.com/hpcloud/tail"
)
func main() {
t, _ := tail.TailFile("/var/log/syslog", tail.Config{Follow: true})
for line := range t.Lines {
fmt.Println(line.Text)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment