Add and enforce golangci-lint (#16)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user