>
    genrule(
        name = "mocks",
        srcs = ["interfaces.go"],
        tools = {
            "mockgen": ["mockgen"],
        },
        cmd = "$TOOLS_MOCKGEN ... $SRCS -o $OUT"
        outs = ???,
    )
      </code>
    </pre>

    <p>
      It's difficult to know ahead of time which files mockgen is going to
      generate. It's dependent on the source code within
      <code class="code">interfaces.go</code>. We can use output directories for
      this:
    </p>

    <pre class="code-container