swag.go 273 B

1234567891011121314151617181920
  1. package initialize
  2. import (
  3. "bytes"
  4. "fmt"
  5. "os"
  6. "os/exec"
  7. )
  8. // SwagInit 初始化swag
  9. func SwagInit() {
  10. cmd := exec.Command("swag", "init")
  11. var out bytes.Buffer
  12. cmd.Stdout = &out
  13. cmd.Stderr = os.Stderr
  14. if err := cmd.Start(); err != nil {
  15. fmt.Println(err)
  16. }
  17. }