makefile: build
This commit is contained in:
parent
c0bdfa469f
commit
0e08a84842
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/bin/*
|
8
Makefile
Normal file
8
Makefile
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
build: fmt
|
||||||
|
CGO_ENABLED=0 go build -ldflags '-s -w' -v -o bin/main ./
|
||||||
|
|
||||||
|
tool-gofumpt:
|
||||||
|
which golangci-lint > /dev/null 2>&1 || go install mvdan.cc/gofumpt@latest
|
||||||
|
|
||||||
|
fmt: tool-gofumpt
|
||||||
|
gofumpt -w --extra .
|
8
main.go
8
main.go
|
@ -3,12 +3,13 @@ package main
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
"github.com/labstack/echo/v4/middleware"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/labstack/echo/v4/middleware"
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Commands = []*cli.Command{}
|
var Commands = []*cli.Command{}
|
||||||
|
@ -97,7 +98,6 @@ func apiList(ctx echo.Context, directory, url string) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.String(http.StatusInternalServerError, fmt.Sprintf("{\"error\":\"%s\"", err))
|
return ctx.String(http.StatusInternalServerError, fmt.Sprintf("{\"error\":\"%s\"", err))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue