1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Clean up the CircleCI module's API credentials loading

This commit is contained in:
Chris Cummer
2018-07-31 15:05:20 -07:00
parent 8fdaf52610
commit dd4088d76e
2 changed files with 10 additions and 7 deletions

View File

@@ -9,6 +9,8 @@ import (
"net/http"
"net/url"
"os"
"github.com/senorprogrammer/wtf/wtf"
)
const APIEnvKey = "WTF_CIRCLE_API_KEY"
@@ -59,7 +61,10 @@ func circleRequest(path string) (*http.Response, error) {
}
func apiKey() string {
return os.Getenv(APIEnvKey)
return wtf.Config.UString(
"wtf.mods.circleci.apiKey",
os.Getenv(APIEnvKey),
)
}
func parseJson(obj interface{}, text io.Reader) {