mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01:00 
			
		
		
		
	Made linter happy in cmd folder
This commit is contained in:
		| @@ -14,6 +14,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	// CmdAdmin represents the available admin sub-command. | ||||
| 	CmdAdmin = cli.Command{ | ||||
| 		Name:  "admin", | ||||
| 		Usage: "Preform admin operations on command line", | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import ( | ||||
| 	"github.com/urfave/cli" | ||||
| ) | ||||
|  | ||||
| // CmdCert represents the available cert sub-command. | ||||
| var CmdCert = cli.Command{ | ||||
| 	Name:  "cert", | ||||
| 	Usage: "Generate self-signed certificate", | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| // Copyright 2014 The Gogs Authors. All rights reserved. | ||||
| // Use of this source code is governed by a MIT-style | ||||
| // license that can be found in the LICENSE file. | ||||
|  | ||||
| package cmd | ||||
|  | ||||
| import ( | ||||
| @@ -13,6 +14,7 @@ import ( | ||||
| 	"github.com/urfave/cli" | ||||
| ) | ||||
|  | ||||
| // CmdCert represents the available cert sub-command. | ||||
| var CmdCert = cli.Command{ | ||||
| 	Name:        "cert", | ||||
| 	Usage:       "Generate self-signed certificate", | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import ( | ||||
| 	"github.com/go-gitea/gitea/modules/setting" | ||||
| ) | ||||
|  | ||||
| // CmdDump represents the available dump sub-command. | ||||
| var CmdDump = cli.Command{ | ||||
| 	Name:  "dump", | ||||
| 	Usage: "Dump Gogs files and database", | ||||
|   | ||||
| @@ -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" | ||||
| 				} | ||||
|   | ||||
| @@ -14,6 +14,7 @@ import ( | ||||
| 	"github.com/go-gitea/gitea/modules/setting" | ||||
| ) | ||||
|  | ||||
| // CmdUpdate represents the available update sub-command. | ||||
| var CmdUpdate = cli.Command{ | ||||
| 	Name:        "update", | ||||
| 	Usage:       "This command should only be called by Git hook", | ||||
|   | ||||
| @@ -48,6 +48,7 @@ import ( | ||||
| 	"github.com/go-gitea/gitea/routers/user" | ||||
| ) | ||||
|  | ||||
| // CmdWeb represents the available web sub-command. | ||||
| var CmdWeb = cli.Command{ | ||||
| 	Name:  "web", | ||||
| 	Usage: "Start Gogs web server", | ||||
| @@ -60,6 +61,7 @@ and it takes care of all the other things for you`, | ||||
| 	}, | ||||
| } | ||||
|  | ||||
| // VerChecker is a listing of required dependency versions. | ||||
| type VerChecker struct { | ||||
| 	ImportPath string | ||||
| 	Version    func() string | ||||
|   | ||||
		Reference in New Issue
	
	Block a user