Add comments

This commit is contained in:
kolaente 2020-09-01 18:22:53 +02:00
parent 96fada53ff
commit 0d427711f9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions

View File

@ -188,7 +188,7 @@ func checkAndInstallGoTool(tool, importPath string) {
}
}
// Cleans all build, executable and bindata files.
// Cleans all build, executable and bindata files
func Clean() error {
if err := exec.Command("go", "clean", "./...").Run(); err != nil {
return err
@ -249,12 +249,14 @@ func FmtCheck() error {
return nil
}
// Runs golint on all packages
func Lint() {
checkAndInstallGoTool("golint", "golang.org/x/lint/golint")
args := append([]string{"-set_exit_status"}, ApiPackages...)
runAndStreamOutput("golint", args...)
}
// Generates the swagger docs from the code annotations
func DoTheSwag() {
checkAndInstallGoTool("swag", "github.com/swaggo/swag/cmd/swag")
runAndStreamOutput("swag", "init", "-g", "./pkg/routes/routes.go", "--parseDependency", "-d", RootPath, "-o", RootPath+"/pkg/swagger")
@ -293,7 +295,7 @@ func Generate() {
runAndStreamOutput("go", "generate", PACKAGE+"/pkg/static")
}
// Builds a vikunja binary, ready to run.
// Builds a vikunja binary, ready to run
func Build() {
mg.Deps(Generate)
runAndStreamOutput("go", "build", Goflags[0], "-tags", Tags, "-ldflags", "-s -w "+Ldflags, "-o", Executable)