Update template (#1335)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/tal-tech/go-zero/tools/goctl/internal/version"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ const (
|
|||||||
os = "OS"
|
os = "OS"
|
||||||
arch = "ARCH"
|
arch = "ARCH"
|
||||||
goctlVersion = "GOCTL_VERSION"
|
goctlVersion = "GOCTL_VERSION"
|
||||||
|
goVersion = "GO_VERSION"
|
||||||
)
|
)
|
||||||
|
|
||||||
var openCmd = map[string]string{
|
var openCmd = map[string]string{
|
||||||
@@ -29,9 +31,9 @@ var openCmd = map[string]string{
|
|||||||
|
|
||||||
func Action(_ *cli.Context) error {
|
func Action(_ *cli.Context) error {
|
||||||
env := getEnv()
|
env := getEnv()
|
||||||
content := fmt.Sprintf(issueTemplate, "<pre>\n"+env.string()+"</pre>")
|
content := fmt.Sprintf(issueTemplate, version.BuildVersion, env.string())
|
||||||
content = url.QueryEscape(content)
|
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
|
goos := runtime.GOOS
|
||||||
var cmd string
|
var cmd string
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/tal-tech/go-zero/tools/goctl/internal/version"
|
"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))
|
w.WriteString(fmt.Sprintf("%s = %q\n", k, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
return w.String()
|
return strings.TrimSuffix(w.String(),"\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func getEnv() env {
|
func getEnv() env {
|
||||||
@@ -28,5 +29,6 @@ func getEnv() env {
|
|||||||
e[os] = runtime.GOOS
|
e[os] = runtime.GOOS
|
||||||
e[arch] = runtime.GOARCH
|
e[arch] = runtime.GOARCH
|
||||||
e[goctlVersion] = version.BuildVersion
|
e[goctlVersion] = version.BuildVersion
|
||||||
|
e[goctlVersion] = runtime.Version()
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,42 @@
|
|||||||
package bug
|
package bug
|
||||||
|
|
||||||
const issueTemplate=`
|
const issueTemplate=`
|
||||||
<!-- Please submit an issue order by the following template. Thanks! -->
|
<!-- Please answer these questions before submitting your issue. Thanks! -->
|
||||||
|
|
||||||
**Describe the bug**
|
### What category of issue (<code>goctl</code> or <code>sdk</code>)?
|
||||||
<!-- A clear and concise description of what the bug is. -->
|
|
||||||
|
|
||||||
**To Reproduce**
|
### What type of issue (<code>feature</code>|<code>bug</code>|<code>suggestion</code>)?
|
||||||
<!-- Steps to reproduce the behavior, if applicable: -->
|
|
||||||
|
|
||||||
1. The code is
|
### What version of Goctl are you using (<code>goctl --version</code>)?
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
$ goctl --version
|
||||||
</pre>
|
|
||||||
|
|
||||||
2. The error is
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
<!-- A clear and concise description of what you expected to happen. -->
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
|
||||||
|
|
||||||
**Environments (please complete the following information):**
|
|
||||||
<!-- - OS: [e.g. Linux]
|
|
||||||
- go-zero version [e.g. 1.2.1]
|
|
||||||
- goctl version [e.g. 1.2.1, optional] -->
|
|
||||||
%s
|
%s
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
### Does this issue reproduce with the latest release?
|
||||||
|
|
||||||
|
|
||||||
|
### What operating system and processor architecture are you using ?
|
||||||
|
<pre>
|
||||||
|
%s
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
### What did you do?
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If possible, provide a recipe for reproducing the error.
|
||||||
|
A complete runnable program is good.
|
||||||
|
A link on play.golang.org is best.
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### What did you expect to see?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### What did you see instead?
|
||||||
|
|
||||||
**More description**
|
|
||||||
<!-- Add any other context about the problem here. -->
|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user