Made linter happy in cmd folder

This commit is contained in:
Thomas Boerger 2016-11-04 12:42:18 +01:00
parent 212a04a45e
commit 5b5af7daee
No known key found for this signature in database
GPG key ID: 5A388F55283960B6
7 changed files with 14 additions and 5 deletions

View file

@ -26,9 +26,10 @@ import (
)
const (
_ACCESS_DENIED_MESSAGE = "Repository does not exist or you do not have access"
accessDenied = "Repository does not exist or you do not have access"
)
// CmdServ represents the available serv sub-command.
var CmdServ = cli.Command{
Name: "serv",
Usage: "This command should only be called by SSH shell",
@ -179,7 +180,7 @@ func runServ(c *cli.Context) error {
repo, err := models.GetRepositoryByName(repoUser.ID, reponame)
if err != nil {
if models.IsErrRepoNotExist(err) {
fail(_ACCESS_DENIED_MESSAGE, "Repository does not exist: %s/%s", repoUser.Name, reponame)
fail(accessDenied, "Repository does not exist: %s/%s", repoUser.Name, reponame)
}
fail("Internal error", "Failed to get repository: %v", err)
}
@ -241,7 +242,7 @@ func runServ(c *cli.Context) error {
if err != nil {
fail("Internal error", "Fail to check access: %v", err)
} else if mode < requestedMode {
clientMessage := _ACCESS_DENIED_MESSAGE
clientMessage := accessDenied
if mode >= models.ACCESS_MODE_READ {
clientMessage = "You do not have sufficient authorization for this action"
}