From 78698d5429985896ed2afacddc28d9045b23d995 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Tue, 22 Dec 2015 11:23:17 +0100 Subject: [PATCH 1/2] cli/hydra-host/handler/tls.go: no formatting directive in Errorf call --- cli/hydra-host/handler/tls.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/hydra-host/handler/tls.go b/cli/hydra-host/handler/tls.go index c03cb25e77b..8a493d1e0f6 100644 --- a/cli/hydra-host/handler/tls.go +++ b/cli/hydra-host/handler/tls.go @@ -18,12 +18,13 @@ import ( "crypto/x509/pkix" "encoding/pem" "fmt" - "github.com/codegangsta/cli" "math/big" "net" "os" "strings" "time" + + "github.com/codegangsta/cli" ) func publicKey(priv interface{}) interface{} { @@ -149,7 +150,7 @@ func CreateDummyTLSCert(ctx *cli.Context) error { keyOut, err := os.OpenFile(ctx.String("key-file-path"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { - return fmt.Errorf("failed to open key.pem for writing:", err) + return fmt.Errorf("failed to open key.pem for writing: %v", err) } pem.Encode(keyOut, pemBlockForKey(priv)) keyOut.Close() From 16fddf2c516b1fe1b86a1681812b874a8b7f3e1c Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Tue, 22 Dec 2015 11:23:34 +0100 Subject: [PATCH 2/2] oauth/provider/signin/signin.go: arg err for printf verb %d of wrong type: error --- oauth/provider/signin/signin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oauth/provider/signin/signin.go b/oauth/provider/signin/signin.go index 3870a656a46..e63e4b11b15 100644 --- a/oauth/provider/signin/signin.go +++ b/oauth/provider/signin/signin.go @@ -3,11 +3,12 @@ package signin import ( "encoding/json" "fmt" + "net/http" + "github.com/go-errors/errors" . "github.com/ory-am/hydra/oauth/provider" "github.com/parnurzeal/gorequest" "golang.org/x/oauth2" - "net/http" ) type signin struct { @@ -46,7 +47,7 @@ func (d *signin) Exchange(code string) (Session, error) { var p payload if err := json.Unmarshal([]byte(body), &p); err != nil { - return nil, errors.Errorf("Could not parse answer: %d", err) + return nil, errors.Errorf("Could not parse answer: %v", err) } if p.Subject == "" {