adding app version, and putting it in the footer

This commit is contained in:
Vincent Batts 2013-02-12 11:09:41 -05:00
parent e7ec9528d0
commit 6a40f02d9e
2 changed files with 17 additions and 5 deletions

View File

@ -1,9 +1,9 @@
package main package main
import ( import (
//"html/template" "fmt"
"text/template"
"io" "io"
"text/template"
) )
var emptyInterface interface{} var emptyInterface interface{}
@ -144,7 +144,7 @@ func UrliePage(w io.Writer) (err error) {
if (err != nil) { if (err != nil) {
return err return err
} }
err = tailTemplate.Execute(w, map[string]string{"footer" : ""}) err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
if (err != nil) { if (err != nil) {
return err return err
} }
@ -167,7 +167,7 @@ func UploadPage(w io.Writer) (err error) {
if (err != nil) { if (err != nil) {
return err return err
} }
err = tailTemplate.Execute(w, map[string]string{"footer" : ""}) err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
if (err != nil) { if (err != nil) {
return err return err
} }
@ -191,7 +191,7 @@ func ListFilesPage(w io.Writer, files []File) (err error) {
if (err != nil) { if (err != nil) {
return err return err
} }
err = tailTemplate.Execute(w, map[string]string{"footer" : ""}) err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
if (err != nil) { if (err != nil) {
return err return err
} }

12
version.go Normal file
View File

@ -0,0 +1,12 @@
package main
import (
"fmt"
)
var (
MAJOR int = 1
MINOR int = 0
TINY int = 0
VERSION string = fmt.Sprintf("%d.%d.%d", MAJOR, MINOR, TINY)
)