本文整理匯總了Golang中github.com/mtojek/go-url-fuzzer/configuration.Configuration.OutputFile方法的典型用法代碼示例。如果您正苦於以下問題:Golang Configuration.OutputFile方法的具體用法?Golang Configuration.OutputFile怎麽用?Golang Configuration.OutputFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mtojek/go-url-fuzzer/configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.OutputFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewFileWriter
// NewFileWriter creates new instance of a file writer.
func NewFileWriter(configuration *configuration.Configuration) *FileWriter {
var outputFile *os.File
var error error
path, defined := configuration.OutputFile()
if defined {
log.Printf("Opening file \"%v\" for writing.", path)
outputFile, error = os.Create(path)
if nil != error {
log.Fatalf("Error occured while opening file \"%v\", error: %v", path, error)
}
}
return &FileWriter{outputFile: outputFile}
}
示例2: NewResultBroadcaster
// NewResultBroadcaster creates new instance of result broadcaster.
func NewResultBroadcaster(configuration *configuration.Configuration) *ResultBroadcaster {
_, isDefined := configuration.OutputFile()
return &ResultBroadcaster{isOutputFileDefined: isDefined}
}