diff --git a/Dockerfile b/Dockerfile index af7280d9..86e5b60e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,8 @@ WORKDIR /go/src/github.com/lifei6671/godoc RUN chmod +x start.sh RUN go get -d ./... && \ - go build -v -o godoc-linux-amd64 -ldflags "-w" + go get github.com/mitchellh/gox && \ + gox CMD ["./start.sh"] \ No newline at end of file diff --git a/models/options.go b/models/options.go index 9b68ff22..0dca5fdc 100644 --- a/models/options.go +++ b/models/options.go @@ -56,9 +56,7 @@ func (p *Option) FindByKey(key string) (*Option,error) { func GetOptionValue(key, def string) string { - option := NewOption() - - if err := option.FindByKey(key); err == nil { + if option,err := NewOption().FindByKey(key); err == nil { return option.OptionValue } return def diff --git a/routers/filter.go b/routers/filter.go index 24100a76..5a61d5cf 100644 --- a/routers/filter.go +++ b/routers/filter.go @@ -5,7 +5,6 @@ import ( "github.com/astaxie/beego/context" "github.com/lifei6671/godoc/conf" "github.com/lifei6671/godoc/models" - "strings" ) func init() {