From 6ee59f20114f8c9128e406bdc683ddc832ea0f62 Mon Sep 17 00:00:00 2001 From: jbpratt78 Date: Thu, 13 Aug 2020 20:25:42 -0500 Subject: [PATCH] chore: update deps and swap to fork of gocui --- .goreleaser.yml | 3 +++ chat.go | 2 +- go.mod | 8 +++----- go.sum | 14 ++++++++------ guiwrapper.go | 2 +- main.go | 4 ++-- ui.go | 22 +++++++++++----------- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index d4fb772..a28d064 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,6 +4,9 @@ before: builds: - env: - CGO_ENABLED=0 + ignore: + - goos: darwin + goarch: 386 archives: - replacements: darwin: Darwin diff --git a/chat.go b/chat.go index e399da9..56abe7b 100644 --- a/chat.go +++ b/chat.go @@ -5,7 +5,7 @@ import ( "sort" "strings" - "github.com/jroimartin/gocui" + "github.com/awesome-gocui/gocui" "github.com/voloshink/dggchat" ) diff --git a/go.mod b/go.mod index 4c4534a..54af3a3 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,10 @@ module github.com/MemeLabs/tsgg -go 1.12 +go 1.15 require ( github.com/BurntSushi/toml v0.3.1 - github.com/gorilla/websocket v1.4.0 // indirect - github.com/jroimartin/gocui v0.4.0 - github.com/mattn/go-runewidth v0.0.4 // indirect - github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762 // indirect + github.com/awesome-gocui/gocui v0.6.0 + github.com/gorilla/websocket v1.4.2 // indirect github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e ) diff --git a/go.sum b/go.sum index 94ed0c9..c8c68b7 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,14 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/jroimartin/gocui v0.4.0 h1:52jnalstgmc25FmtGcWqa0tcbMEWS6RpFLsOIO+I+E8= -github.com/jroimartin/gocui v0.4.0/go.mod h1:7i7bbj99OgFHzo7kB2zPb8pXLqMBSQegY7azfqXMkyY= +github.com/awesome-gocui/gocui v0.6.0 h1:hhDJiQC12tEsJNJ+iZBBVaSSLFYo9llFuYpQlL5JZVI= +github.com/awesome-gocui/gocui v0.6.0/go.mod h1:1QikxFaPhe2frKeKvEwZEIGia3haiOxOUXKinrv17mA= +github.com/awesome-gocui/termbox-go v0.0.0-20190427202837-c0aef3d18bcc h1:wGNpKcHU8Aadr9yOzsT3GEsFLS7HQu8HxQIomnekqf0= +github.com/awesome-gocui/termbox-go v0.0.0-20190427202837-c0aef3d18bcc/go.mod h1:tOy3o5Nf1bA17mnK4W41gD7PS3u4Cv0P0pqFcoWMy8s= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762 h1:44Lv0bNi88GweB54TCjB/lEJgp+2Ze5WFpwNu0nh0ag= -github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e h1:qszPE5tSNvsYJErKxKdECVtODU9fzi/F37qFjwR1jRU= github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e/go.mod h1:5j1ON0lAci8VnW4dkkgsmJcO/wWrzhonglKAxV5FHXA= diff --git a/guiwrapper.go b/guiwrapper.go index 4176e2c..4d55494 100644 --- a/guiwrapper.go +++ b/guiwrapper.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/jroimartin/gocui" + "github.com/awesome-gocui/gocui" ) type guiwrapper struct { diff --git a/main.go b/main.go index ca40a3d..54edaee 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "time" "github.com/BurntSushi/toml" - "github.com/jroimartin/gocui" + "github.com/awesome-gocui/gocui" "github.com/voloshink/dggchat" ) @@ -61,7 +61,7 @@ func main() { log.Fatalf("malformed configuration file: %v\n", err) } - g, err := gocui.NewGui(gocui.OutputNormal) + g, err := gocui.NewGui(gocui.OutputNormal, false) if err != nil { log.Panicln(err) } diff --git a/ui.go b/ui.go index 3da3ec4..2a632b4 100644 --- a/ui.go +++ b/ui.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/jroimartin/gocui" + "github.com/awesome-gocui/gocui" "github.com/voloshink/dggchat" ) @@ -64,8 +64,8 @@ func layout(g *gocui.Gui) error { maxX, maxY := g.Size() g.Cursor = true - if messages, err := g.SetView("debug", maxX/4*2, 0, maxX-20, maxY/3); err != nil { - if err != gocui.ErrUnknownView { + if messages, err := g.SetView("debug", int(maxX/4*2), 0, maxX-20, maxY/3, 0); err != nil { + if !gocui.IsUnknownView(err) { return err } messages.Title = " debug: " @@ -73,8 +73,8 @@ func layout(g *gocui.Gui) error { messages.Autoscroll = true } - if messages, err := g.SetView("help", maxX/4*2, 0, maxX-20, maxY/2); err != nil { - if err != gocui.ErrUnknownView { + if messages, err := g.SetView("help", maxX/4*2, 0, maxX-20, maxY/2, 0); err != nil { + if !gocui.IsUnknownView(err) { return err } messages.Title = " help: " @@ -107,8 +107,8 @@ func layout(g *gocui.Gui) error { xDimension = maxX - 1 } - if messages, err := g.SetView("messages", 0, 0, xDimension, maxY-3); err != nil { - if err != gocui.ErrUnknownView { + if messages, err := g.SetView("messages", 0, 0, xDimension, maxY-3, 0); err != nil { + if !gocui.IsUnknownView(err) { return err } messages.Title = " messages: " @@ -116,8 +116,8 @@ func layout(g *gocui.Gui) error { messages.Wrap = true } - if input, err := g.SetView("input", 0, maxY-3, xDimension, maxY-1); err != nil { - if err != gocui.ErrUnknownView { + if input, err := g.SetView("input", 0, maxY-3, xDimension, maxY-1, 0); err != nil { + if !gocui.IsUnknownView(err) { return err } input.Title = " send: " @@ -128,8 +128,8 @@ func layout(g *gocui.Gui) error { g.SetCurrentView("input") } - if users, err := g.SetView("users", maxX-20, 0, maxX-1, maxY-1); err != nil { - if err != gocui.ErrUnknownView { + if users, err := g.SetView("users", maxX-20, 0, maxX-1, maxY-1, 0); err != nil { + if !gocui.IsUnknownView(err) { return err } users.Title = " users: "