]> source.dussan.org Git - gitea.git/commitdiff
fix password variable shadowing (#5405)
authorLanre Adelowo <adelowomailbox@gmail.com>
Mon, 26 Nov 2018 15:00:38 +0000 (16:00 +0100)
committerLauris BH <lauris@nix.lv>
Mon, 26 Nov 2018 15:00:38 +0000 (17:00 +0200)
cmd/admin.go

index 9422e507099e822315d75b3f16f0e2d564e788d8..ac911f184bba2e798b371533723787ecf4b3ecc5 100644 (file)
@@ -301,7 +301,8 @@ func runCreateUser(c *cli.Context) error {
        if c.IsSet("password") {
                password = c.String("password")
        } else if c.IsSet("random-password") {
-               password, err := generate.GetRandomString(c.Int("random-password-length"))
+               var err error
+               password, err = generate.GetRandomString(c.Int("random-password-length"))
                if err != nil {
                        return err
                }