Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
zenthangplus committed Jun 11, 2022
1 parent 580e714 commit 717b434
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions option.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package workerpool

import (
"fmt"
)

type Mode int
type LogFunc func(msgFormat string, args ...interface{})

Expand Down Expand Up @@ -42,9 +38,7 @@ func WithLogFunc(logFunc LogFunc) OptionFunc {

func makeDefaultOption(option *Option) {
if option.LogFunc == nil {
option.LogFunc = func(msgFormat string, args ...interface{}) {
fmt.Printf(msgFormat, args...)
}
option.LogFunc = defaultLogFunc
}
if option.Mode != FixedSize && option.Mode != FlexibleSize {
option.Mode = FixedSize
Expand Down
1 change: 0 additions & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func NewFixedSize(numberWorkers int, optionFunc ...OptionFunc) *Pool {
opt := Option{
Mode: FixedSize,
NumberWorkers: numberWorkers,
LogFunc: defaultLogFunc,
}
for _, optFunc := range optionFunc {
optFunc(&opt)
Expand Down

0 comments on commit 717b434

Please sign in to comment.