aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAmine <hilalyamine@gmail.com>2019-05-27 20:26:36 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-29 22:58:01 +0200
commit5ea0cb138bd4152724afa73909db508e73452fd1 (patch)
tree94f6eb5668ca2be6f42ca1f49e1b40631477d41b /bridge
parentaa439fae06df64883455039accfc81fa479f1a8d (diff)
downloadgit-bug-5ea0cb138bd4152724afa73909db508e73452fd1.tar.gz
Update documentation and function naming
Co-Authored-By: Michael Muré <batolettre@gmail.com>
Diffstat (limited to 'bridge')
-rw-r--r--bridge/github/config.go7
-rw-r--r--bridge/launchpad/config.go5
2 files changed, 7 insertions, 5 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go
index 2430de9c..f44be472 100644
--- a/bridge/github/config.go
+++ b/bridge/github/config.go
@@ -196,7 +196,7 @@ func promptTokenOptions(owner, project string) (string, error) {
for {
fmt.Println()
fmt.Println("[0]: user provided token")
- fmt.Println("[1]: automated token creation")
+ fmt.Println("[1]: interactive token creation")
fmt.Print("Select option: ")
line, err := bufio.NewReader(os.Stdin).ReadString('\n')
@@ -258,7 +258,6 @@ func loginAndRequestToken(owner, project string) (string, error) {
fmt.Println(" - 'repo:public_repo': to be able to read public repositories")
fmt.Println("Private:")
fmt.Println(" - 'repo' : to be able to read private repositories")
- // fmt.Println("The token will have the \"repo\" permission, giving it read/write access to your repositories and issues. There is no narrower scope available, sorry :-|")
fmt.Println()
// prompt project visibility to know the token scope needed for the repository
@@ -346,7 +345,7 @@ func promptUsername() (string, error) {
}
func promptURL(remotes map[string]string) (string, string, error) {
- validRemotes := getValideGithubRemoteURLs(remotes)
+ validRemotes := getValidGithubRemoteURLs(remotes)
if len(validRemotes) > 0 {
for {
fmt.Println("\nDetected projects:")
@@ -419,7 +418,7 @@ func splitURL(url string) (shortURL string, owner string, project string, err er
return res[0], res[1], res[2], nil
}
-func getValideGithubRemoteURLs(remotes map[string]string) []string {
+func getValidGithubRemoteURLs(remotes map[string]string) []string {
urls := make([]string, 0, len(remotes))
for _, url := range remotes {
// split url can work again with shortURL
diff --git a/bridge/launchpad/config.go b/bridge/launchpad/config.go
index c5f72c01..ef206fd5 100644
--- a/bridge/launchpad/config.go
+++ b/bridge/launchpad/config.go
@@ -92,7 +92,10 @@ func promptProjectName() (string, error) {
func validateProject(project string) (bool, error) {
url := fmt.Sprintf("%s/%s", apiRoot, project)
- resp, err := http.Get(url)
+ client := := &http.Client{
+ Timeout: defaultTimeout,
+ }
+ resp, err := client.Get(url)
if err != nil {
return false, err
}