aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/config.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-06-16 23:02:59 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-06-16 23:02:59 +0200
commit319b648d0f2d30c457c56df860dcecf89c80157a (patch)
tree8e4cfd58f79d47890110896450effdcf7e66721c /bridge/github/config.go
parentf70e775dbd7c53ebb6e3cd2ec1af8d73d13449b0 (diff)
downloadgit-bug-319b648d0f2d30c457c56df860dcecf89c80157a.tar.gz
Naming fixes
Diffstat (limited to 'bridge/github/config.go')
-rw-r--r--bridge/github/config.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go
index 9c1bbcbb..1971abbc 100644
--- a/bridge/github/config.go
+++ b/bridge/github/config.go
@@ -17,7 +17,6 @@ import (
"time"
"github.com/pkg/errors"
-
"golang.org/x/crypto/ssh/terminal"
"github.com/MichaelMure/git-bug/bridge/core"
@@ -25,6 +24,7 @@ import (
)
const (
+ target = "github"
githubV3Url = "https://api.github.com"
keyTarget = "target"
keyOwner = "owner"
@@ -102,7 +102,7 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) (
return nil, fmt.Errorf("project doesn't exist or authentication token has an incorrect scope")
}
- conf[keyTarget] = "github"
+ conf[keyTarget] = target
conf[keyToken] = token
conf[keyOwner] = owner
conf[keyProject] = project
@@ -111,8 +111,10 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) (
}
func (*Github) ValidateConfig(conf core.Configuration) error {
- if _, ok := conf[keyTarget]; !ok {
+ if v, ok := conf[keyTarget]; !ok {
return fmt.Errorf("missing %s key", keyTarget)
+ } else if v != target {
+ return fmt.Errorf("unexpected target name: %v", v)
}
if _, ok := conf[keyToken]; !ok {