]> source.dussan.org Git - gitea.git/commitdiff
Made linter happy in cmd folder
authorThomas Boerger <thomas@webhippie.de>
Fri, 4 Nov 2016 11:42:18 +0000 (12:42 +0100)
committerThomas Boerger <thomas@webhippie.de>
Fri, 4 Nov 2016 22:45:06 +0000 (23:45 +0100)
cmd/admin.go
cmd/cert.go
cmd/cert_stub.go
cmd/dump.go
cmd/serve.go
cmd/update.go
cmd/web.go

index a10e0e5fe5409a8181e1d629500cab483b1bf0b0..de77143f292914a81f0e291468f8c0b1d8995dba 100644 (file)
@@ -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",
index 6cd5bfade4f2ee3d8479fe99c1e0210f4ad45505..2212d2972d719b80f2b52713dc4e621e32df4d62 100644 (file)
@@ -25,10 +25,11 @@ import (
        "github.com/urfave/cli"
 )
 
+// CmdCert represents the available cert sub-command.
 var CmdCert = cli.Command{
        Name:  "cert",
        Usage: "Generate self-signed certificate",
-       Description: `Generate a self-signed X.509 certificate for a TLS server. 
+       Description: `Generate a self-signed X.509 certificate for a TLS server.
 Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
        Action: runCert,
        Flags: []cli.Flag{
index 1c076f6495225c308ee57c9237bab215eb896c9d..a97a497e1f8a878d6d0fdc008660fc62b5fe9b27 100644 (file)
@@ -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",
index 1e03ef74f0ef04680eef8907efd4928b91d5452c..8af76e2fc7192be2e223b7fda63ebf1f28ab6d09 100644 (file)
@@ -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",
index 051e215db1bc940285174a9373079e365c24b440..c4e7d13046b2201da0a3bfc6207fe65a4b542d5c 100644 (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"
                                }
index 450d18a08ad1e62d91b89f0e0d3b87d78f7ddb05..ef494121e95aad05038c849ea7f2c60db793894d 100644 (file)
@@ -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",
index d5dae5badc6150d5a67e4c490871f9a621de1f47..ee9ee4d9519a5e3fc0a5a2c77d750bb5f228c37c 100644 (file)
@@ -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
@@ -99,7 +101,7 @@ func checkVersion() {
        for _, c := range checkers {
                if !version.Compare(c.Version(), c.Expected, ">=") {
                        log.Fatal(4, `Dependency outdated!
-Package '%s' current version (%s) is below requirement (%s), 
+Package '%s' current version (%s) is below requirement (%s),
 please use following command to update this package and recompile Gogs:
 go get -u %[1]s`, c.ImportPath, c.Version(), c.Expected)
                }