Skip to content

Commit

Permalink
various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fclairamb committed Mar 3, 2024
1 parent fb67573 commit f018bb5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ linters:
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- exhaustive
- errchkjson
- errname
- errorlint
# - exhaustivestruct
- exportloopref
- funlen
Expand Down
2 changes: 1 addition & 1 deletion client_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func (c *clientHandler) handleCommandsStreamError(err error) {

c.logger.Error("Network error", "err", err)
default:
if err == io.EOF {
if errors.Is(err, io.EOF) {
if c.debug {
c.logger.Debug("Client disconnected", "clean", false)
}
Expand Down
2 changes: 1 addition & 1 deletion driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewTestServerWithDriverAndLogger(t *testing.T, driver MainDriver, logger lo
})

go func() {
if err := s.Serve(); err != nil && err != io.EOF {
if err := s.Serve(); err != nil && errors.Is(err, io.EOF) {
s.Logger.Error("problem serving", "err", err)
}
}()
Expand Down
4 changes: 2 additions & 2 deletions handle_dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *clientHandler) checkLISTArgs(args string) string {
func (c *clientHandler) handleLIST(param string) error {
info := fmt.Sprintf("LIST %v", param)

if files, _, err := c.getFileList(param, true); err == nil || err == io.EOF {
if files, _, err := c.getFileList(param, true); err == nil || errors.Is(err, io.EOF) {
if tr, errTr := c.TransferOpen(info); errTr == nil {
err = c.dirTransferLIST(tr, files)
c.TransferClose(err)
Expand All @@ -207,7 +207,7 @@ func (c *clientHandler) handleLIST(param string) error {
func (c *clientHandler) handleNLST(param string) error {
info := fmt.Sprintf("NLST %v", param)

if files, parentDir, err := c.getFileList(param, true); err == nil || err == io.EOF {
if files, parentDir, err := c.getFileList(param, true); err == nil || errors.Is(err, io.EOF) {
if tr, errTrOpen := c.TransferOpen(info); errTrOpen == nil {
err = c.dirTransferNLST(tr, files, parentDir)
c.TransferClose(err)
Expand Down

0 comments on commit f018bb5

Please sign in to comment.