goctl added
This commit is contained in:
26
tools/goctl/api/apigen/util.go
Normal file
26
tools/goctl/api/apigen/util.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package apigen
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getGitName() string {
|
||||
cmd := exec.Command("git", "config", "user.name")
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return strings.TrimSpace(string(out))
|
||||
}
|
||||
|
||||
func getGitEmail() string {
|
||||
cmd := exec.Command("git", "config", "user.email")
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return strings.TrimSpace(string(out))
|
||||
}
|
||||
Reference in New Issue
Block a user