fix golint warnings

This commit is contained in:
2020-07-25 19:55:40 -04:00
parent d26bb34800
commit d59bcff9fa
3 changed files with 38 additions and 36 deletions

View File

@ -114,7 +114,7 @@ func (client *GUI) renderContentArea() fyne.CanvasObject {
client.contentPane = widget.NewVBox()
if client.selectedChannel == "" {
return client.contentPane
} else {
}
if client.selectedMessage != 0 {
var currentMessage data.Message
for _, msg := range client.db.chanList[client.selectedChannel] {
@ -156,7 +156,6 @@ func (client *GUI) renderContentArea() fyne.CanvasObject {
}
}
}
}
return client.contentPane
}

View File

@ -20,7 +20,7 @@ type database struct {
Messages []data.Message
}
func NewDatabase() *database {
func newDatabase() *database {
return new(database)
}

5
gui.go
View File

@ -13,6 +13,7 @@ import (
"github.com/kpetku/syndie-core/fetcher"
)
// GUI contains various GUI configuration options
type GUI struct {
db *database
window fyne.Window
@ -30,12 +31,14 @@ type GUI struct {
selectedMessage int
}
// NewGUI creates a new GUI
func NewGUI() *GUI {
return new(GUI)
}
// Start launches a new syndie-gui application
func (client *GUI) Start(path string) {
client.db = NewDatabase()
client.db = newDatabase()
client.db.openDB(path)
client.db.reload()