Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to pass arguments #2

Open
yields opened this issue Dec 17, 2014 · 0 comments
Open

add ability to pass arguments #2

yields opened this issue Dec 17, 2014 · 0 comments

Comments

@yields
Copy link
Owner

yields commented Dec 17, 2014

useful when you want to randomize actions etc..

{
  "action": "{{one track,identify,alias,page,group}}"
}

need to refactor generators to return errors, so that we can report errors if you don't supply arguments:

func one(g *Generator, args...string) (string, error){
  if 0 == len(args) { return "", errors.New("expected arguments") }
  return args[rand.Intn(len(args))], nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant