go fmt. vet
This commit is contained in:
parent
871790de23
commit
7e943c8b4d
2
Makefile
2
Makefile
|
@ -39,6 +39,8 @@ run: $(BINARY)
|
||||||
./$(BINARY) -vv serve
|
./$(BINARY) -vv serve
|
||||||
|
|
||||||
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES) $(DOCS_ASSET)
|
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES) $(DOCS_ASSET)
|
||||||
|
go vet ./...
|
||||||
|
go test ./...
|
||||||
go build "sour.is/x/paste/cmd/paste"
|
go build "sour.is/x/paste/cmd/paste"
|
||||||
|
|
||||||
$(ROUTE_ASSET): $(ROUTE_FILES)
|
$(ROUTE_ASSET): $(ROUTE_FILES)
|
||||||
|
|
|
@ -27,13 +27,13 @@
|
||||||
package main // import "sour.is/x/paste/cmd/paste"
|
package main // import "sour.is/x/paste/cmd/paste"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
_ "sour.is/x/paste/src/docs"
|
_ "sour.is/x/paste/src/docs"
|
||||||
_ "sour.is/x/paste/src/routes"
|
_ "sour.is/x/paste/src/routes"
|
||||||
"sour.is/x/toolbox/httpsrv"
|
"sour.is/x/toolbox/httpsrv"
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"syscall"
|
|
||||||
"sour.is/x/toolbox/log"
|
"sour.is/x/toolbox/log"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "sour.is/x/toolbox/httpsrv"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
httpsrv.AssetRegister("docs", httpsrv.AssetRoutes{
|
httpsrv.AssetRegister("docs", httpsrv.AssetRoutes{
|
||||||
{"Assets", "/docs/", httpsrv.FsHtml5(assetFS())},
|
{Name: "Assets", Path: "/docs/", HandlerFunc: httpsrv.FsHtml5(assetFS())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,15 @@ func init() {
|
||||||
httpsrv.RegisterModule("paste", setConfig)
|
httpsrv.RegisterModule("paste", setConfig)
|
||||||
|
|
||||||
httpsrv.HttpRegister("paste", httpsrv.HttpRoutes{
|
httpsrv.HttpRegister("paste", httpsrv.HttpRoutes{
|
||||||
{"getRandom", "GET", "/paste/rng", getRandom},
|
{Name: "getRandom", Method: "GET", Pattern: "/paste/rng", HandlerFunc: getRandom},
|
||||||
{"getPaste", "GET", "/paste/{id}", getPaste},
|
{Name: "getPaste", Method: "GET", Pattern: "/paste/{id}", HandlerFunc: getPaste},
|
||||||
{"getPaste", "GET", "/paste/get/{id}", getPaste},
|
{Name: "getPaste", Method: "GET", Pattern: "/paste/get/{id}", HandlerFunc: getPaste},
|
||||||
{"postPaste", "POST", "/paste", postPaste},
|
{Name: "postPaste", Method: "POST", Pattern: "/paste", HandlerFunc: postPaste},
|
||||||
|
|
||||||
{"getRandom", "GET", "/api/rng", getRandom},
|
{Name: "getRandom", Method: "GET", Pattern: "/api/rng", HandlerFunc: getRandom},
|
||||||
{"getPaste", "GET", "/api/{id}", getPaste},
|
{Name: "getPaste", Method: "GET", Pattern: "/api/{id}", HandlerFunc: getPaste},
|
||||||
{"getPaste", "GET", "/api/get/{id}", getPaste},
|
{Name: "getPaste", Method: "GET", Pattern: "/api/get/{id}", HandlerFunc: getPaste},
|
||||||
{"postPaste", "POST", "/api", postPaste},
|
{Name: "postPaste", Method: "POST", Pattern: "/api", HandlerFunc: postPaste},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "sour.is/x/toolbox/httpsrv"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
httpsrv.AssetRegister("paste", httpsrv.AssetRoutes{
|
httpsrv.AssetRegister("paste", httpsrv.AssetRoutes{
|
||||||
{"Assets", "/", httpsrv.FsHtml5(assetFS())},
|
{Name: "Assets", Path: "/", HandlerFunc: httpsrv.FsHtml5(assetFS())},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user