Skip to content

Commit

Permalink
dupword
Browse files Browse the repository at this point in the history
  • Loading branch information
fclairamb committed Mar 3, 2024
1 parent b8e8124 commit fb67573
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ linters-settings:
linters:
disable-all: true
enable:
# https://golangci-lint.run/usage/linters/
- asciicheck
- asasalint
- bidichk
Expand All @@ -168,10 +169,12 @@ linters:
- containedctx
# - contextcheck -> creates an odd error here: https://github.com/fclairamb/ftpserverlib/blob/4d7c663e9e0b2650673fc2e0fcdb443895f2a1b9/server.go#L234
# - copyloopvar -> unknown in v1.56.2 ???
- cyclop
# - cyclop -> Delaying it for now (too much work)
- decorder
- depguard
- dogsled
- dupl
- dupword
- errcheck
- exhaustive
# - exhaustivestruct
Expand Down
6 changes: 5 additions & 1 deletion handle_dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ const (
dateFormatStatYear = "Jan _2 2006" // LIST date formatting with year
dateFormatStatOldSwitch = time.Hour * 24 * 30 * 6 // 6 months ago
dateFormatMLSD = "20060102150405" // MLSD date formatting
fakeUser = "ftp"
fakeGroup = "ftp"
)

func (c *clientHandler) fileStat(file os.FileInfo) string {
Expand All @@ -290,8 +292,10 @@ func (c *clientHandler) fileStat(file os.FileInfo) string {
}

return fmt.Sprintf(
"%s 1 ftp ftp %12d %s %s",
"%s 1 %s %s %12d %s %s",
file.Mode(),
fakeUser,
fakeGroup,
file.Size(),
file.ModTime().Format(dateFormat),
file.Name(),
Expand Down

0 comments on commit fb67573

Please sign in to comment.