Extract main logic into attack function and test it

This commit is contained in:
Tomás Senart
2013-08-14 17:30:13 +02:00
parent 8c26088706
commit c1e4962972
4 changed files with 63 additions and 34 deletions

View File

@@ -49,8 +49,8 @@ func NewTargets(source io.Reader) (Targets, error) {
return targets, nil
}
func (t Targets) Iter(random bool) []int {
if random {
func (t Targets) Iter(ordering string) []int {
if ordering == "random" {
return rand.Perm(len(t))
}
iter := make([]int, len(t))