Made linter happy in cmd folder
This commit is contained in:
parent
212a04a45e
commit
5b5af7daee
7 changed files with 14 additions and 5 deletions
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue