You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
463 B
Go
33 lines
463 B
Go
3 years ago
|
package bug
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"fmt"
|
||
|
"runtime"
|
||
|
|
||
|
"github.com/tal-tech/go-zero/tools/goctl/internal/version"
|
||
|
)
|
||
|
|
||
|
type env map[string]string
|
||
|
|
||
|
func (e env) string() string {
|
||
|
if e == nil {
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
w := bytes.NewBuffer(nil)
|
||
|
for k, v := range e {
|
||
|
w.WriteString(fmt.Sprintf("%s = %q\n", k, v))
|
||
|
}
|
||
|
|
||
|
return w.String()
|
||
|
}
|
||
|
|
||
|
func getEnv() env {
|
||
|
e := make(env)
|
||
|
e[os] = runtime.GOOS
|
||
|
e[arch] = runtime.GOARCH
|
||
|
e[goctlVersion] = version.BuildVersion
|
||
|
return e
|
||
|
}
|