From 52f3fc853d9dce8653d398ef179b8c00f779c7de Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 11 Aug 2016 15:16:19 +0100 Subject: [PATCH] More inlining --- src/github.com/matrix-org/go-neb/realms/jira/jira.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/github.com/matrix-org/go-neb/realms/jira/jira.go b/src/github.com/matrix-org/go-neb/realms/jira/jira.go index 142e09d..c28f9cf 100644 --- a/src/github.com/matrix-org/go-neb/realms/jira/jira.go +++ b/src/github.com/matrix-org/go-neb/realms/jira/jira.go @@ -238,15 +238,13 @@ func (r *JIRARealm) ProjectKeyExists(userID, projectKey string) (bool, error) { // JIRAClient returns an authenticated jira.Client for the given userID. Returns an unauthenticated // client if allowUnauth is true and no authenticated session is found, else returns an error. func (r *JIRARealm) JIRAClient(userID string, allowUnauth bool) (*jira.Client, error) { - var cli *jira.Client // Check if user has an auth session. session, err := database.GetServiceDB().LoadAuthSessionByUser(r.id, userID) if err != nil { if err == sql.ErrNoRows { if allowUnauth { // make an unauthenticated client - cli, err = jira.NewClient(nil, r.JIRAEndpoint) - return cli, err + return jira.NewClient(nil, r.JIRAEndpoint) } return nil, errors.New("No authenticated session found for " + userID) } @@ -273,8 +271,7 @@ func (r *JIRARealm) JIRAClient(userID string, allowUnauth bool) (*jira.Client, e context.TODO(), oauth1.NewToken(jsession.AccessToken, jsession.AccessSecret), ) - cli, err = jira.NewClient(httpClient, r.JIRAEndpoint) - return cli, err + return jira.NewClient(httpClient, r.JIRAEndpoint) } func (r *JIRARealm) ensureInited() error {