title: How to generate coverage for multiple packages using go test in custom folders?
body: <p>We have following project structure:</p>
  
  <pre><code>├── Makefile
  ├── ...
  ├── src
  │   ├── app
  │   │   ├── main.go
  │   │   ├── models
  │   │       ├── ...
  │   │       └── dao.go
  │   │   ├── ...
  │   │   └── controllers
  │   │       ├── ...
  │   │       └── pingController.go
  │   └── test
  │       ├── all_test.go
  │       ├── ...
  │       └── controllers_test.go
  └── vendor
      └── src
          ├── github.com
          ├── golang.org
          └── gopkg.in
  </code></pre>
  
  <p>I want to measure coverage of packages in src/app by tests in src/test. And currently generating coverage profile by running custom script that runs coverage for each package in app and then merges all coverage profiles into one file. Recently I heard that in go1.10 we are able to generate coverage for multiple packages.</p>
  
  <p>So I tried to replace that script with oneliner, and tried running</p>
  
  <pre><code>GOPATH=${PROJECT_DIR}:${PROJECT_DIR}/vendor go test -covermode count -coverprofile cover.out -coverpkg all ./src/test/...
  </code></pre>
  
  <p>It gives me "ok     test    0.475s  coverage: 0.0% of statements in all"</p>
  
  <p>When I do </p>
  
  <pre><code>cd src/test/
  GOPATH=${PROJECT_DIR}:${PROJECT_DIR}/vendor go test -covermode count -coverprofile cover.out -coverpkg all
  </code></pre>
  
  <p>Logs show that specs are runned and tests are successfull, but still I have "coverage: 0.0% of statements in all" and empty cover.out.</p>
  
  <p>What am I missing to properly compute coverage of packages in app by tests in test? </p>