Drone CI and linting (#14)

This commit is contained in:
2019-10-16 18:32:21 +00:00
committed by Gitea
parent ef597063cf
commit 5acc64de59
12 changed files with 51 additions and 11 deletions

View File

@@ -18,7 +18,9 @@ func throwGoImports(ec echo.Context) error {
// to list available packages.
// For now only package itself is supported, all other features in ToDo.
packageNameRaw := ec.Request().URL.Path
pkgs, errs := configuration.Cfg.GetPackagesInfo([]string{packageNameRaw})
if errs != nil {
log.Error().Str("package", packageNameRaw).Msgf("Failed to get package information: %+v", errs)
return ec.JSON(http.StatusBadRequest, &structs.Reply{Status: structs.StatusFailure, Errors: errs})

View File

@@ -24,7 +24,9 @@ func packagesGET(ec echo.Context) error {
log.Info().Msgf("Received package(s) info get request: %+v", req)
var pkgs map[string]*structs.Package
var errors []structs.Error
if req.All {
pkgs = configuration.Cfg.GetAllPackagesInfo()
} else {