style: run goimports

This commit is contained in:
1138-4EB 2018-08-11 18:19:16 +01:00
parent ad054f541f
commit 5cdae3b733
6 changed files with 28 additions and 26 deletions

View File

@ -8,10 +8,10 @@ import (
// dbCmd represents the db command // dbCmd represents the db command
var dbCmd = &cobra.Command{ var dbCmd = &cobra.Command{
Use: "db", Use: "db",
Version: rootCmd.Version, Version: rootCmd.Version,
Aliases: []string{"database"}, Aliases: []string{"database"},
Short: "A brief description of your command", Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example: and usage of using your command. For example:

View File

@ -14,14 +14,14 @@ var cfgFile string
// rootCmd represents the base command when called without any subcommands // rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "filebrowser", Use: "filebrowser",
Version: "(untracked)", Version: "(untracked)",
Aliases: []string{"serve"}, Aliases: []string{"serve"},
Short: "A stylish web-based file manager", Short: "A stylish web-based file manager",
Long: `File Browser is static binary composed of a golang backend Long: `File Browser is static binary composed of a golang backend
and a Vue.js frontend to create, edit, copy, move, download your files and a Vue.js frontend to create, edit, copy, move, download your files
easily, everywhere, every time.`, easily, everywhere, every time.`,
// Run: func(cmd *cobra.Command, args []string) {}, // Run: func(cmd *cobra.Command, args []string) {},
} }
// Execute adds all child commands to the root command and sets flags appropriately. // Execute adds all child commands to the root command and sets flags appropriately.

View File

@ -1,8 +1,8 @@
package cmd package cmd
import ( import (
"os"
"log" "log"
"os"
) )
// checkRootAlias compares the first argument provided in the CLI with a list of // checkRootAlias compares the first argument provided in the CLI with a list of

View File

@ -1,17 +1,17 @@
package cmd package cmd
import ( import (
filebrowser "github.com/filebrowser/filebrowser/lib"
"github.com/spf13/cobra" "github.com/spf13/cobra"
v "github.com/spf13/viper" v "github.com/spf13/viper"
filebrowser "github.com/filebrowser/filebrowser/lib"
) )
// serveCmd represents the serve command // serveCmd represents the serve command
var serveCmd = &cobra.Command{ var serveCmd = &cobra.Command{
Use: "serve", Use: "serve",
Version: rootCmd.Version, Version: rootCmd.Version,
Aliases: []string{"server"}, Aliases: []string{"server"},
Short: "A brief description of your command", Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example: and usage of using your command. For example:
@ -65,14 +65,14 @@ func init() {
// User default settings // User default settings
var defaults = struct { var defaults = struct {
commands string commands string
scope string scope string
viewMode string viewMode string
allowCommands bool allowCommands bool
allowEdit bool allowEdit bool
allowNew bool allowNew bool
allowPublish bool allowPublish bool
locale string locale string
}{ }{
"git svn hg", "git svn hg",
".", ".",

View File

@ -1,20 +1,21 @@
package cmd package cmd
import ( import (
"github.com/spf13/viper"
"github.com/asdine/storm"
filebrowser "github.com/filebrowser/filebrowser/lib"
"github.com/filebrowser/filebrowser/lib/bolt"
h "github.com/filebrowser/filebrowser/lib/http"
"github.com/filebrowser/filebrowser/lib/staticgen"
"github.com/hacdias/fileutils"
"gopkg.in/natefinch/lumberjack.v2"
"io/ioutil" "io/ioutil"
"log" "log"
"net" "net"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"github.com/asdine/storm"
filebrowser "github.com/filebrowser/filebrowser/lib"
"github.com/filebrowser/filebrowser/lib/bolt"
h "github.com/filebrowser/filebrowser/lib/http"
"github.com/filebrowser/filebrowser/lib/staticgen"
"github.com/hacdias/fileutils"
"github.com/spf13/viper"
"gopkg.in/natefinch/lumberjack.v2"
) )
func Serve() { func Serve() {
@ -51,9 +52,9 @@ func Serve() {
if b { if b {
if viper.GetString("Auth.Header") == "" { if viper.GetString("Auth.Header") == "" {
log.Fatal("The 'auth.header' needs to be specified when '", m,"' authentication is used.") log.Fatal("The 'auth.header' needs to be specified when '", m, "' authentication is used.")
} }
log.Println("[WARN] Filebrowser authentication is configured to '", m,"' authentication. This can cause a huge security issue if the infrastructure is not configured correctly.") log.Println("[WARN] Filebrowser authentication is configured to '", m, "' authentication. This can cause a huge security issue if the infrastructure is not configured correctly.")
} }
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"text/template" "text/template"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )