Add and enforce golangci-lint (#16)

This commit is contained in:
Dave Gallant
2020-07-05 22:44:05 -04:00
committed by GitHub
parent 2ec9bca107
commit d9474be233
13 changed files with 141 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
package controller
import (
"log"
config "github.com/davegallant/srv/config"
feeds "github.com/davegallant/srv/feeds"
)
@@ -12,9 +14,19 @@ type Controller struct {
CurrentFeed int
}
// Init initiates the controller with config
func (c *Controller) Init(conf string) {
c.Config = config.LoadConfiguration(conf)
// Init initiates the controller
func (c *Controller) Init() {
configPath, err := config.GetUserConfigPath()
if err != nil {
log.Fatal("Unable to locate user's config path")
}
c.Config, err = config.LoadConfiguration(configPath)
if err != nil {
log.Fatalf("Unable to load configuration: %s", err)
}
c.Rss = &feeds.RSS{}
c.Rss.Update(c.Config.Feeds)
c.CurrentFeed = 0