Skip to content

Commit

Permalink
refactor: remove unecessary interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 8, 2023
1 parent 2fe6b5d commit fdac8d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions pool/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pool
import (
"archive/zip"
"bytes"
"io"
"io/fs"
"os"
"path/filepath"
Expand All @@ -13,18 +12,12 @@ import (

const defaultBufferSize = 2 * 1024 * 1024

type Overflow interface {
io.ReadWriteSeeker
io.Closer
Name() string
}

type File struct {
Path string
Info fs.FileInfo
CompressedData bytes.Buffer
Header *zip.FileHeader
Overflow Overflow
Overflow *os.File
written int64
}

Expand Down
4 changes: 2 additions & 2 deletions pool/file_worker_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
minconcurrency = 1
minConcurrency = 1
capacity = 1
)

Expand All @@ -21,7 +21,7 @@ type FileWorkerPool struct {
}

func NewFileWorkerPool(concurrency int, executor func(f File) error) (*FileWorkerPool, error) {
if concurrency < minconcurrency {
if concurrency < minConcurrency {
return nil, errors.New("number of workers must be greater than 0")
}

Expand Down

0 comments on commit fdac8d4

Please sign in to comment.