From 577535c89789b8ee9d11cc02bb71b45c7ab13988 Mon Sep 17 00:00:00 2001 From: gmemstr Date: Mon, 25 Sep 2017 09:04:29 -0700 Subject: [PATCH] gofmt --- assets/static/setup.css | 1 + src/configreader.go | 18 ++++++++++-------- src/vendor/github.com/gmemstr/feeds/feed.go | 6 +++--- src/vendor/github.com/gmemstr/feeds/rss.go | 6 +++--- src/webserver.go | 7 ------- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/assets/static/setup.css b/assets/static/setup.css index 1bf7af0..751c6dd 100644 --- a/assets/static/setup.css +++ b/assets/static/setup.css @@ -11,6 +11,7 @@ body { label { display: block; } + input,textarea { margin-bottom: 10px; padding: 10px; diff --git a/src/configreader.go b/src/configreader.go index 65e7409..40213c5 100644 --- a/src/configreader.go +++ b/src/configreader.go @@ -1,17 +1,19 @@ package main import ( - "io/ioutil" "encoding/json" + "io/ioutil" ) type Config struct { - Name string - Host string - Email string - Description string - Image string - PodcastUrl string + Name string + Host string + Email string + Description string + Image string + PodcastUrl string + AdminUsername string + AdminPassword string } func ReadConfig() Config { @@ -27,4 +29,4 @@ func ReadConfig() Config { } return c -} \ No newline at end of file +} diff --git a/src/vendor/github.com/gmemstr/feeds/feed.go b/src/vendor/github.com/gmemstr/feeds/feed.go index 2e707c8..f756abf 100644 --- a/src/vendor/github.com/gmemstr/feeds/feed.go +++ b/src/vendor/github.com/gmemstr/feeds/feed.go @@ -17,7 +17,7 @@ type Author struct { type Image struct { Url, Title, Link string - Width, Height int + Width, Height int } type Enclosure struct { @@ -33,7 +33,7 @@ type Item struct { Id string // used as guid in rss, id in atom Updated time.Time Created time.Time - Enclosure *Enclosure + Enclosure *Enclosure } type Feed struct { @@ -47,7 +47,7 @@ type Feed struct { Subtitle string Items []*Item Copyright string - Image *Image + Image *Image } // add a new Item to a Feed diff --git a/src/vendor/github.com/gmemstr/feeds/rss.go b/src/vendor/github.com/gmemstr/feeds/rss.go index 4bc8ebf..c53373c 100644 --- a/src/vendor/github.com/gmemstr/feeds/rss.go +++ b/src/vendor/github.com/gmemstr/feeds/rss.go @@ -7,8 +7,8 @@ package feeds import ( "encoding/xml" "fmt" - "time" "strconv" + "time" ) // private wrapper around the RssFeed which gives us the .. xml @@ -122,7 +122,7 @@ func (r *Rss) RssFeed() *RssFeed { } } - image := &RssImage{Url: r.Image.Url, Title: r.Image.Title, Link: r.Image.Link, Width:r.Image.Width, Height: r.Image.Height} + image := &RssImage{Url: r.Image.Url, Title: r.Image.Title, Link: r.Image.Link, Width: r.Image.Width, Height: r.Image.Height} channel := &RssFeed{ Title: r.Title, @@ -132,7 +132,7 @@ func (r *Rss) RssFeed() *RssFeed { PubDate: pub, LastBuildDate: build, Copyright: r.Copyright, - Image: image, + Image: image, } for _, i := range r.Items { channel.Items = append(channel.Items, newRssItem(i)) diff --git a/src/webserver.go b/src/webserver.go index 9da47f9..690a015 100644 --- a/src/webserver.go +++ b/src/webserver.go @@ -92,13 +92,6 @@ func AdminHandler(w http.ResponseWriter, r *http.Request) { // Main function that defines routes func main() { - viper.SetConfigName("config") - viper.AddConfigPath(".") - err := viper.ReadInConfig() // Find and read the config file - if err != nil { // Handle errors reading the config file - panic(fmt.Errorf("Fatal error config file: %s \n", err)) - } - // Start the watch() function in generate_rss.go, which // watches for file changes and regenerates the feed go watch()