diff --git a/tools/goctl/bug/bug.go b/tools/goctl/bug/bug.go index 65d0eaa28..07d4a0ebb 100644 --- a/tools/goctl/bug/bug.go +++ b/tools/goctl/bug/bug.go @@ -6,6 +6,7 @@ import ( "os/exec" "runtime" + "github.com/tal-tech/go-zero/tools/goctl/internal/version" "github.com/urfave/cli" ) @@ -20,6 +21,7 @@ const ( os = "OS" arch = "ARCH" goctlVersion = "GOCTL_VERSION" + goVersion = "GO_VERSION" ) var openCmd = map[string]string{ @@ -29,9 +31,9 @@ var openCmd = map[string]string{ func Action(_ *cli.Context) error { env := getEnv() - content := fmt.Sprintf(issueTemplate, "
\n"+env.string()+"
") + content := fmt.Sprintf(issueTemplate, version.BuildVersion, env.string()) content = url.QueryEscape(content) - url := fmt.Sprintf("https://github.com/zeromicro/go-zero/issues/new?title=TODO&body=%s", content) + url := fmt.Sprintf("https://github.com/zeromicro/go-zero/issues/new?body=%s", content) goos := runtime.GOOS var cmd string diff --git a/tools/goctl/bug/env.go b/tools/goctl/bug/env.go index 4ca90c7fc..6f954520b 100644 --- a/tools/goctl/bug/env.go +++ b/tools/goctl/bug/env.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "runtime" + "strings" "github.com/tal-tech/go-zero/tools/goctl/internal/version" ) @@ -20,7 +21,7 @@ func (e env) string() string { w.WriteString(fmt.Sprintf("%s = %q\n", k, v)) } - return w.String() + return strings.TrimSuffix(w.String(),"\n") } func getEnv() env { @@ -28,5 +29,6 @@ func getEnv() env { e[os] = runtime.GOOS e[arch] = runtime.GOARCH e[goctlVersion] = version.BuildVersion + e[goctlVersion] = runtime.Version() return e } diff --git a/tools/goctl/bug/issue.go b/tools/goctl/bug/issue.go index 1757e0f62..c3cd09818 100644 --- a/tools/goctl/bug/issue.go +++ b/tools/goctl/bug/issue.go @@ -1,39 +1,42 @@ package bug const issueTemplate=` - + -**Describe the bug** - +### What category of issue (goctl or sdk)? -**To Reproduce** - +### What type of issue (feature|bug|suggestion)? -1. The code is +### What version of Goctl are you using (goctl --version)? -
-	
-	
- -2. The error is - -
-	
-	
- -**Expected behavior** - - -**Screenshots** - - -**Environments (please complete the following information):** - +
+$ goctl --version
 %s
+
+ +### Does this issue reproduce with the latest release? + + +### What operating system and processor architecture are you using ? +
+%s
+
+ +### What did you do? + + + + + +### What did you expect to see? + + + +### What did you see instead? -**More description** - `