♻️ dayNight主题更新 + 一些重构

This commit is contained in:
naiba
2021-01-24 21:17:37 +08:00
parent 691d04ac62
commit b19a704aee
8 changed files with 26 additions and 20 deletions

9
cmd/playground/example.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -x
ME=`whoami`
ping example.com -c20 && \
echo "==== $ME ====" && \
ping example.net -c20 && \
echo "==== done! ===="

View File

@@ -6,6 +6,7 @@ import (
"log"
"net"
"net/http"
"os"
"os/exec"
"time"
@@ -16,8 +17,9 @@ import (
func main() {
// icmp()
// tcpping()
httpWithSSLInfo()
// httpWithSSLInfo()
// diskinfo()
cmdExec()
}
func tcpping() {
@@ -71,13 +73,12 @@ func icmp() {
}
func cmdExec() {
cmd := exec.Command("ping", "example.com", "-c2")
execFrom, err := os.Getwd()
if err != nil {
panic(err)
}
cmd := exec.Command(execFrom + "/cmd/playground/example.sh")
output, err := cmd.Output()
log.Println("output:", string(output))
log.Println("err:", err)
cmd = exec.Command("ping", "example", "-c2")
output, err = cmd.Output()
log.Println("output:", string(output))
log.Println("err:", err)
}