本文整理汇总了Golang中github.com/jddixon/rnglib_go.PRNG.NextDataDir方法的典型用法代码示例。如果您正苦于以下问题:Golang PRNG.NextDataDir方法的具体用法?Golang PRNG.NextDataDir怎么用?Golang PRNG.NextDataDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/jddixon/rnglib_go.PRNG
的用法示例。
在下文中一共展示了PRNG.NextDataDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: makeOneNamedTestDirectory
func makeOneNamedTestDirectory(c *C, rng *xr.PRNG, name string,
depth, width int) (dirPath string) {
dirPath = fmt.Sprintf("tmp/%s", name)
if _, err := os.Stat(dirPath); err == nil {
err = os.RemoveAll(dirPath)
c.Assert(err, IsNil)
}
// maxLen, minLen of files (bytes)
rng.NextDataDir(dirPath, depth, width, 4096, 32)
return
}
示例2: makeOneNamedTestDirectory
func (s *XLSuite) makeOneNamedTestDirectory(c *C, rng *xr.PRNG,
name string, depth, width int) string {
name = strings.TrimSpace(name)
dirPath := fmt.Sprintf("tmp/%s", name)
if strings.Contains(dirPath, "..") {
msg := fmt.Sprintf("directory name '%s' contains a double-dot\n", name)
panic(msg)
}
err := os.RemoveAll(dirPath)
c.Assert(err, IsNil)
// max/minLen
rng.NextDataDir(dirPath, depth, width, 32, 1)
return dirPath
}