本文整理汇总了Golang中github.com/diffeo/go-coordinate/jobserver.JobServer.Clear方法的典型用法代码示例。如果您正苦于以下问题:Golang JobServer.Clear方法的具体用法?Golang JobServer.Clear怎么用?Golang JobServer.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/diffeo/go-coordinate/jobserver.JobServer
的用法示例。
在下文中一共展示了JobServer.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: delWorkUnitsBy
// delWorkUnitsBy is the core of the DelWorkUnits tests that expect to
// delet single work units. It calls options(state) to get options
// to DelWorkUnits, and verifies that this deletes the single work unit
// associated with state.
func delWorkUnitsBy(t *testing.T, j *jobserver.JobServer, n int, state jobserver.WorkUnitStatus, options func(jobserver.WorkUnitStatus) map[string]interface{}) {
workSpecName, expected := prepareSomeOfEach(t, j, n)
delete(expected, stateShortName[state])
count, msg, err := j.DelWorkUnits(workSpecName, options(state))
if assert.NoError(t, err) {
assert.Equal(t, 1, count)
assert.Empty(t, msg)
}
listWorkUnits(t, j, workSpecName, gwuEverything, expected)
_, err = j.Clear()
assert.NoError(t, err)
}