diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-12-06 09:39:33 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-12-06 09:39:33 +0000 |
| commit | 6031ce78df6cda9c8b924b231554bb4e0c077358 (patch) | |
| tree | 6427bcab0e0207f40d03ccbe7b424de728116172 /internal/io/fs/readfile.go | |
| parent | 7ec5c5b144866c392e3676778041a2ae6aa9d360 (diff) | |
Refactor local context filter method to reduce its cognitive complexity
Diffstat (limited to 'internal/io/fs/readfile.go')
| -rw-r--r-- | internal/io/fs/readfile.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/io/fs/readfile.go b/internal/io/fs/readfile.go index f37b07d..90c5966 100644 --- a/internal/io/fs/readfile.go +++ b/internal/io/fs/readfile.go @@ -26,6 +26,7 @@ import ( type readStatus int const ( + nothing readStatus = iota abortReading readStatus = iota continueReading readStatus = iota ) @@ -300,7 +301,7 @@ func (f *readFile) handleReadError(ctx context.Context, err error, fd *os.File, return abortReading, nil } - return continueReading, nil + return nothing, nil } // Now process the byte we just read from the fd. @@ -333,5 +334,5 @@ func (f *readFile) handleReadByte(ctx context.Context, b byte, } } - return continueReading, message + return nothing, message } |
