took care of linting

This commit is contained in:
Jacob 2017-11-09 09:56:33 +01:00
parent 59c54ed10a
commit dfa7a280f0
2 changed files with 37 additions and 38 deletions

View File

@ -1,13 +1,14 @@
package main package main
import ( import (
"fmt"
"html/template" "html/template"
"io/ioutil" "io/ioutil"
"time"
"fmt"
"strings" "strings"
"time"
) )
//Post : Is exported
type Post struct { type Post struct {
Date time.Time Date time.Time
Title string Title string
@ -15,9 +16,9 @@ type Post struct {
Content template.HTML Content template.HTML
} }
var lewd string = "Lewd Interlude" var lewd = "Lewd Interlude"
var reveries string = "Takunomi Coffee Reveries, Vol. I" var reveries = "Takunomi Coffee Reveries, Vol. I"
var romantic string = "Romantic Japanese Christmas Takunomi Saturday Recap" var romantic = "Romantic Japanese Christmas Takunomi Saturday Recap"
func spaceToHyphen(s string) string { func spaceToHyphen(s string) string {
return strings.Replace(s, " ", "-", -1) return strings.Replace(s, " ", "-", -1)

View File

@ -1,20 +1,21 @@
package main package main
import ( import (
"fmt"
"html/template" "html/template"
"net/http" "net/http"
"strings"
"os" "os"
"fmt" "strings"
) )
//Page : Is exported to PostCollection
type Page struct { type Page struct {
Title string Title string
MenuItems []string MenuItems []string
Posts []Post Posts []Post
} }
var name string = "takunomi" var name = "takunomi"
var posts []Post var posts []Post
var sections = []string{"about", "past", "contact"} var sections = []string{"about", "past", "contact"}
var templates = template.Must(template.ParseFiles("blog.tmpl", "blog_roll.tmpl", "style.tmpl", "post.tmpl")) var templates = template.Must(template.ParseFiles("blog.tmpl", "blog_roll.tmpl", "style.tmpl", "post.tmpl"))
@ -32,8 +33,6 @@ func main() {
http.ListenAndServe(":35291", nil) http.ListenAndServe(":35291", nil)
} }
//http.ListenAndServe(":8080", nil)
} }
func errorHandler(w http.ResponseWriter, req *http.Request, status int) { func errorHandler(w http.ResponseWriter, req *http.Request, status int) {
@ -68,4 +67,3 @@ func renderTemplates (w http.ResponseWriter, p Page) {
s3 := templates.Lookup("post.tmpl") s3 := templates.Lookup("post.tmpl")
s3.ExecuteTemplate(w, "post", nil) s3.ExecuteTemplate(w, "post", nil)
} }