code: func Env() Environment {
  	switch {
  	case os.Getenv("CI") == "true" && os.Getenv("TRAVIS") == "true":
  		return Environment{
  			Name:          "travis",
  			Repo:          os.Getenv("TRAVIS_REPO_SLUG"),
  			Commit:        os.Getenv("TRAVIS_COMMIT"),
  			Branch:        os.Getenv("TRAVIS_BRANCH"),
  			Tag:           os.Getenv("TRAVIS_TAG"),
  			Buildnum:      os.Getenv("TRAVIS_BUILD_NUMBER"),
  			IsPullRequest: os.Getenv("TRAVIS_PULL_REQUEST") != "false",
  			IsCronJob:     os.Getenv("TRAVIS_EVENT_TYPE") == "cron",
  		}
  	case os.Getenv("CI") == "True" && os.Getenv("APPVEYOR") == "True":
  		return Environment{
  			Name:          "appveyor",
  			Repo:          os.Getenv("APPVEYOR_REPO_NAME"),
  			Commit:        os.Getenv("APPVEYOR_REPO_COMMIT"),
  			Branch:        os.Getenv("APPVEYOR_REPO_BRANCH"),
  			Tag:           os.Getenv("APPVEYOR_REPO_TAG_NAME"),
  			Buildnum:      os.Getenv("APPVEYOR_BUILD_NUMBER"),
  			IsPullRequest: os.Getenv("APPVEYOR_PULL_REQUEST_NUMBER") != "",
  			IsCronJob:     os.Getenv("APPVEYOR_SCHEDULED_BUILD") == "True",
  		}
  	default:
  		return LocalEnv()
  	}
  }
docs: // Env returns metadata about the current CI environment, falling back to LocalEnv
  // if not running on CI.