1234567891011121314151617181920 |
- package initialize
- import (
- "bytes"
- "fmt"
- "os"
- "os/exec"
- )
- // SwagInit 初始化swag
- func SwagInit() {
- cmd := exec.Command("swag", "init")
- var out bytes.Buffer
- cmd.Stdout = &out
- cmd.Stderr = os.Stderr
- if err := cmd.Start(); err != nil {
- fmt.Println(err)
- }
- }
|