add default VERSION string

This commit is contained in:
Will Norris 2013-12-26 13:55:52 -08:00
parent 67bf2f0675
commit c3eda83ab5

View file

@ -29,7 +29,8 @@ import (
// goxc values // goxc values
var ( var (
// VERSION is the version string for imageproxy. // VERSION is the version string for imageproxy.
VERSION string VERSION = "HEAD"
// BUILD_DATE is the timestamp of when imageproxy was built. // BUILD_DATE is the timestamp of when imageproxy was built.
BUILD_DATE string BUILD_DATE string
) )
@ -47,8 +48,6 @@ func main() {
return return
} }
fmt.Printf("imageproxy (version %v) listening on %s\n", VERSION, *addr)
var c httpcache.Cache var c httpcache.Cache
if *cacheDir != "" { if *cacheDir != "" {
c = diskcache.New(*cacheDir) c = diskcache.New(*cacheDir)
@ -62,10 +61,13 @@ func main() {
if *whitelist != "" { if *whitelist != "" {
p.Whitelist = strings.Split(*whitelist, ",") p.Whitelist = strings.Split(*whitelist, ",")
} }
server := &http.Server{ server := &http.Server{
Addr: *addr, Addr: *addr,
Handler: p, Handler: p,
} }
fmt.Printf("imageproxy (version %v) listening on %s\n", VERSION, server.Addr)
err := server.ListenAndServe() err := server.ListenAndServe()
if err != nil { if err != nil {
log.Fatal("ListenAndServe: ", err) log.Fatal("ListenAndServe: ", err)