refactor(bugCmd): update issue template.

- fix collides with imported package name.
This commit is contained in:
Fernandez Ludovic 2017-04-24 11:38:05 +02:00 committed by Fernandez Ludovic
parent ccff8a80f5
commit 972579e2a0

View file

@ -16,26 +16,51 @@ import (
var ( var (
bugtracker = "https://github.com/containous/traefik/issues/new" bugtracker = "https://github.com/containous/traefik/issues/new"
bugTemplate = `### What version of Traefik are you using? bugTemplate = `<!--
` + "```" + ` How to write a good issue?
{{.Version}}
` + "```" + ` Read https://github.com/containous/traefik/blob/master/.github/how-to-write-a-good-issue.md
And the contributing guide: https://github.com/containous/traefik/blob/master/.github/CONTRIBUTING.md
-->
### Do you want to request a *feature* or report a *bug*?
### What is your environment & configuration (arguments, toml...)?
` + "```" + `
{{.Configuration}}
` + "```" + `
### What did you do? ### What did you do?
### What did you expect to see? ### What did you expect to see?
### What did you see instead? ### What did you see instead?
### If applicable, please paste the log output in debug mode ('--debug' switch)
### Output of ` + "`" + `traefik version` + "`" + `: (_What version of Traefik are you using?_)
` + "```" + `
{{.Version}}
` + "```" + `
### What is your environment & configuration (arguments, toml, provider, platform, ...)?
` + "```" + `toml
{{.Configuration}}
` + "```" + `
<!--
Add more configuration information here.
-->
### If applicable, please paste the log output in debug mode (` + "`" + `--debug` + "`" + ` switch)
` + "```" + `
(paste your output here)
` + "```" + `
` `
) )
@ -78,8 +103,8 @@ func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration in
} }
body := bug.String() body := bug.String()
url := bugtracker + "?body=" + url.QueryEscape(body) URL := bugtracker + "?body=" + url.QueryEscape(body)
if err := openBrowser(url); err != nil { if err := openBrowser(URL); err != nil {
fmt.Print("Please file a new issue at " + bugtracker + " using this template:\n\n") fmt.Print("Please file a new issue at " + bugtracker + " using this template:\n\n")
fmt.Print(body) fmt.Print(body)
} }
@ -92,15 +117,15 @@ func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration in
} }
} }
func openBrowser(url string) error { func openBrowser(URL string) error {
var err error var err error
switch runtime.GOOS { switch runtime.GOOS {
case "linux": case "linux":
err = exec.Command("xdg-open", url).Start() err = exec.Command("xdg-open", URL).Start()
case "windows": case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() err = exec.Command("rundll32", "url.dll,FileProtocolHandler", URL).Start()
case "darwin": case "darwin":
err = exec.Command("open", url).Start() err = exec.Command("open", URL).Start()
default: default:
err = fmt.Errorf("unsupported platform") err = fmt.Errorf("unsupported platform")
} }