change work dir

This commit is contained in:
0xJacky 2022-02-18 18:04:13 +08:00
parent ce850f5e59
commit 08b54b5bbb
31 changed files with 260 additions and 259 deletions

View file

@ -1,20 +0,0 @@
package test
import (
"fmt"
"log"
"os/exec"
"regexp"
"testing"
)
func TestGetNginx(t *testing.T) {
out, err := exec.Command("nginx", "-V").CombinedOutput()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", out)
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
fmt.Println(r.FindStringSubmatch(string(out))[1])
}