Travis-ci在使用go test时需要root特权,如何设置?

I have Go test file and it needs root privilege to run it (go test). How to set it in Travis ci?

Here is yml:

language: go
sudo: required
go:
   - tip
notifications:
  email:
     on_success: change
     on_failure: always

After git push, travis-ci build failing with default configure.

In travis you can use sudo so if you want to run your tests with root permission, change the script section:

script: sudo - E env "PATH=$PATH" go test ./...

Or if you are using a Makefile:

script: sudo - E env "PATH=$PATH" make

script: - sudo env "PATH=$PATH" npm test