go fmt. vet

This commit is contained in:
Jon Lundy 2018-06-26 10:51:21 -06:00
parent 871790de23
commit 7e943c8b4d
Signed by untrusted user who does not match committer: xuu
GPG Key ID: 346DF999B2530DAE
6 changed files with 16 additions and 14 deletions

View File

@ -39,6 +39,8 @@ run: $(BINARY)
./$(BINARY) -vv serve
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES) $(DOCS_ASSET)
go vet ./...
go test ./...
go build "sour.is/x/paste/cmd/paste"
$(ROUTE_ASSET): $(ROUTE_FILES)

View File

@ -72,7 +72,7 @@ func init() {
}
if args["-v"].(int) == 2 {
log.SetVerbose(log.Vdebug)
log.SetFlags(log.LstdFlags|log.Lshortfile)
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.Debug("Debug Logging.")
}

View File

@ -27,13 +27,13 @@
package main // import "sour.is/x/paste/cmd/paste"
import (
"os"
"os/signal"
_ "sour.is/x/paste/src/docs"
_ "sour.is/x/paste/src/routes"
"sour.is/x/toolbox/httpsrv"
"os"
"os/signal"
"syscall"
"sour.is/x/toolbox/log"
"syscall"
)
func main() {

View File

@ -4,7 +4,7 @@ import "sour.is/x/toolbox/httpsrv"
func init() {
httpsrv.AssetRegister("docs", httpsrv.AssetRoutes{
{"Assets", "/docs/", httpsrv.FsHtml5(assetFS())},
{Name: "Assets", Path: "/docs/", HandlerFunc: httpsrv.FsHtml5(assetFS())},
})
}

View File

@ -27,15 +27,15 @@ func init() {
httpsrv.RegisterModule("paste", setConfig)
httpsrv.HttpRegister("paste", httpsrv.HttpRoutes{
{"getRandom", "GET", "/paste/rng", getRandom},
{"getPaste", "GET", "/paste/{id}", getPaste},
{"getPaste", "GET", "/paste/get/{id}", getPaste},
{"postPaste", "POST", "/paste", postPaste},
{Name: "getRandom", Method: "GET", Pattern: "/paste/rng", HandlerFunc: getRandom},
{Name: "getPaste", Method: "GET", Pattern: "/paste/{id}", HandlerFunc: getPaste},
{Name: "getPaste", Method: "GET", Pattern: "/paste/get/{id}", HandlerFunc: getPaste},
{Name: "postPaste", Method: "POST", Pattern: "/paste", HandlerFunc: postPaste},
{"getRandom", "GET", "/api/rng", getRandom},
{"getPaste", "GET", "/api/{id}", getPaste},
{"getPaste", "GET", "/api/get/{id}", getPaste},
{"postPaste", "POST", "/api", postPaste},
{Name: "getRandom", Method: "GET", Pattern: "/api/rng", HandlerFunc: getRandom},
{Name: "getPaste", Method: "GET", Pattern: "/api/{id}", HandlerFunc: getPaste},
{Name: "getPaste", Method: "GET", Pattern: "/api/get/{id}", HandlerFunc: getPaste},
{Name: "postPaste", Method: "POST", Pattern: "/api", HandlerFunc: postPaste},
})
}

View File

@ -4,7 +4,7 @@ import "sour.is/x/toolbox/httpsrv"
func init() {
httpsrv.AssetRegister("paste", httpsrv.AssetRoutes{
{"Assets", "/", httpsrv.FsHtml5(assetFS())},
{Name: "Assets", Path: "/", HandlerFunc: httpsrv.FsHtml5(assetFS())},
})
}