Skip to content

Commit 92fda00

Browse files
committed
🧹: gofmt
1 parent d309066 commit 92fda00

File tree

12 files changed

+22
-23
lines changed

12 files changed

+22
-23
lines changed

auth/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"net/http"
55
"os"
66

7+
"github.com/filebrowser/filebrowser/v2/errors"
78
"github.com/filebrowser/filebrowser/v2/settings"
89
"github.com/filebrowser/filebrowser/v2/users"
9-
"github.com/filebrowser/filebrowser/v2/errors"
1010
)
1111

1212
// MethodProxyAuth is used to identify no auth.

cmd/import.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ func init() {
1616
var importCmd = &cobra.Command{
1717
Use: "import",
1818
Short: "Imports an old configuration",
19-
Long: `Imports an old configuration. This command DOES NOT
19+
Long: `Imports an old configuration. This command DOES NOT
2020
import share links because they are incompatible with
2121
this version.`,
22-
Args: cobra.NoArgs,
22+
Args: cobra.NoArgs,
2323
Run: func(cmd *cobra.Command, args []string) {
2424
oldDB := mustGetString(cmd, "old.database")
2525
oldConf := mustGetString(cmd, "old.config")

cmd/rules.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ func init() {
2020
var rulesCmd = &cobra.Command{
2121
Use: "rules",
2222
Short: "Rules management utility",
23-
Long: `On each subcommand you'll have available at least two flags:
23+
Long: `On each subcommand you'll have available at least two flags:
2424
"username" and "id". You must either set only one of them
2525
or none. If you set one of them, the command will apply to
2626
an user, otherwise it will be applied to the global set or
2727
rules.`,
28-
Args: cobra.NoArgs,
28+
Args: cobra.NoArgs,
2929
Run: func(cmd *cobra.Command, args []string) {
3030
cmd.Help()
3131
os.Exit(0)

http/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewHandler(storage *storage.Storage) (http.Handler, error) {
4949
api.PathPrefix("/raw").Handler(handle(rawHandler, "/api/raw", storage)).Methods("GET")
5050
api.PathPrefix("/command").Handler(handle(commandsHandler, "/api/command", storage)).Methods("GET")
5151
api.PathPrefix("/search").Handler(handle(searchHandler, "/api/search", storage)).Methods("GET")
52-
52+
5353
public := api.PathPrefix("/public").Subrouter()
5454
public.PathPrefix("/dl").Handler(handle(publicDlHandler, "/api/public/dl/", storage)).Methods("GET")
5555
public.PathPrefix("/share").Handler(handle(publicShareHandler, "/api/public/share/", storage)).Methods("GET")

http/resource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717

1818
var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
1919
file, err := files.NewFileInfo(files.FileOptions{
20-
Fs: d.user.Fs,
21-
Path: r.URL.Path,
22-
Modify: d.user.Perm.Modify,
23-
Expand: true,
20+
Fs: d.user.Fs,
21+
Path: r.URL.Path,
22+
Modify: d.user.Perm.Modify,
23+
Expand: true,
2424
Checker: d,
2525
})
2626
if err != nil {

http/static.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package http
22

33
import (
44
"encoding/json"
5-
"text/template"
65
"log"
76
"net/http"
87
"os"
98
"path/filepath"
109
"strings"
10+
"text/template"
1111

1212
"github.com/GeertJohan/go.rice"
1313
"github.com/filebrowser/filebrowser/v2/auth"

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//go:generate cd http && rice embed-go
21
package main
32

43
import (

runner/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package runner
33
import (
44
"os/exec"
55

6-
"github.com/mholt/caddy"
76
"github.com/filebrowser/filebrowser/v2/settings"
7+
"github.com/mholt/caddy"
88
)
99

1010
// ParseCommand parses the command taking in account if the current

search/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Search(fs afero.Fs, scope, query string, checker rules.Checker, found func(
2121
return afero.Walk(fs, scope, func(path string, f os.FileInfo, err error) error {
2222
path = strings.TrimPrefix(path, "/")
2323
path = strings.Replace(path, "\\", "/", -1)
24-
24+
2525
if !checker.Check(path) {
2626
return nil
2727
}

storage/bolt/bolt.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package bolt
22

33
import (
4-
"github.com/filebrowser/filebrowser/v2/settings"
54
"github.com/asdine/storm"
65
"github.com/filebrowser/filebrowser/v2/auth"
6+
"github.com/filebrowser/filebrowser/v2/settings"
77
"github.com/filebrowser/filebrowser/v2/share"
88
"github.com/filebrowser/filebrowser/v2/storage"
99
"github.com/filebrowser/filebrowser/v2/users"
@@ -13,13 +13,13 @@ import (
1313
func NewStorage(db *storm.DB) *storage.Storage {
1414
users := users.NewStorage(usersBackend{db: db})
1515
share := share.NewStorage(shareBackend{db: db})
16-
settings := settings.NewStorage(settingsBackend{ db: db})
16+
settings := settings.NewStorage(settingsBackend{db: db})
1717
auth := auth.NewStorage(authBackend{db: db}, users)
1818

1919
return &storage.Storage{
20-
Auth: auth,
21-
Users: users,
22-
Share: share,
20+
Auth: auth,
21+
Users: users,
22+
Share: share,
2323
Settings: settings,
2424
}
2525
}

storage/bolt/share.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s shareBackend) GetPermanent(path string, id uint) (*share.Link, error) {
2727
if err == storm.ErrNotFound {
2828
return nil, errors.ErrNotExist
2929
}
30-
30+
3131
return &v, err
3232
}
3333

storage/storage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
// Storage is a storage powered by a Backend whih makes the neccessary
1111
// verifications when fetching and saving data to ensure consistency.
1212
type Storage struct {
13-
Users *users.Storage
14-
Share *share.Storage
15-
Auth *auth.Storage
13+
Users *users.Storage
14+
Share *share.Storage
15+
Auth *auth.Storage
1616
Settings *settings.Storage
1717
}

0 commit comments

Comments
 (0)