This commit is contained in:
2019-12-16 21:39:57 +00:00
parent aef592a235
commit f74f153569
4 changed files with 41 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ func TrimSuffix(s, suffix string) string {
func main() {
var searchPath []string
searchPath = append(searchPath,
"/home/starkers/.local/share/Steam/steamapps/compatdata/8500/pfx/drive_c/users/steamuser/My Documents/EVE/logs/Chatlogs")
"~/.local/share/Steam/steamapps/compatdata/8500/pfx/drive_c/users/steamuser/My Documents/EVE/logs/Chatlogs")
usr, _ := user.Current()
dir := usr.HomeDir
+23
View File
@@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/hpcloud/tail"
)
func main() {
// https://godoc.org/github.com/hpcloud/tail#Config
t, err := tail.TailFile(
"/var/log/nginx.log",
tail.Config{
Follow: true,
})
if err != nil {
fmt.Println(err)
}
for line := range t.Lines {
fmt.Println(line.Text)
}
}
+14
View File
@@ -0,0 +1,14 @@
package main
import (
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
)
func main() {
a := app.New()
w := a.NewWindow("window title")
w.SetContent(widget.NewLabel("widget label"))
w.ShowAndRun()
}
+3
View File
@@ -0,0 +1,3 @@
Good notes on file handling:
- https://flaviocopes.com/go-list-files/