Minho 8 lat temu
rodzic
commit
3aa32a3abb
3 zmienionych plików z 3 dodań i 5 usunięć
  1. 2 1
      Dockerfile
  2. 1 3
      models/options.go
  3. 0 1
      routers/filter.go

+ 2 - 1
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"]

+ 1 - 3
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

+ 0 - 1
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()  {