From 9a14bbc9199aca6c6c8e2cc7fd3dec73da61fb9d Mon Sep 17 00:00:00 2001 From: Rohith Date: Wed, 14 Oct 2015 16:04:22 +0100 Subject: [PATCH] - fixed the parsing of the json files - fixed the getDurationWithin(); was returning in ms not seconds --- utils.go | 4 ++-- vault.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/utils.go b/utils.go index dd4bf1b..f0625a7 100644 --- a/utils.go +++ b/utils.go @@ -98,7 +98,7 @@ func readJSONFile(filename string) (map[string]string, error) { return data, err } // unmarshall the data - err = json.Unmarshal(content, data) + err = json.Unmarshal(content, &data) if err != nil { return data, err } @@ -126,7 +126,7 @@ func readYAMLFile(filename string) (map[string]string, error) { // min : the smallest number we can accept // max : the largest number we can accept func getDurationWithin(min, max int) time.Duration { - return time.Duration(rand.Intn(max-min) + min) + return time.Duration(rand.Intn(max-min) + min) * time.Second } // getEnv checks to see if an environment variable exists otherwise uses the default diff --git a/vault.go b/vault.go index de05117..3eecea9 100644 --- a/vault.go +++ b/vault.go @@ -89,6 +89,7 @@ func NewVaultService(url string) (*VaultService, error) { if service.token, err = service.authenticate(options.vaultAuthOptions); err != nil { return nil, err } + // step: set the token for the client service.client.SetToken(service.token)