23 lines
260 B
Go
23 lines
260 B
Go
package swarm
|
|
|
|
import "log"
|
|
|
|
type options struct {
|
|
log *log.Logger
|
|
}
|
|
|
|
type Option func(*options)
|
|
|
|
func WithLog(log *log.Logger) Option {
|
|
return func(o *options) {
|
|
o.log = log
|
|
}
|
|
}
|
|
|
|
func(o *options)repire(){
|
|
if o.log == nil{
|
|
o.log = log.Default()
|
|
}
|
|
}
|
|
|