(filePath string)
| 365 | } |
| 366 | |
| 367 | func openInEditor(filePath string) error { |
| 368 | editor := os.Getenv("EDITOR") |
| 369 | if editor == "" { |
| 370 | return fmt.Errorf("$EDITOR is not set; cannot open file for editing") |
| 371 | } |
| 372 | cmd := exec.Command(editor, filePath) |
| 373 | cmd.Stdin = os.Stdin |
| 374 | cmd.Stdout = os.Stdout |
| 375 | cmd.Stderr = os.Stderr |
| 376 | return cmd.Run() |
| 377 | } |