ForkCurrentToNew creates a fork from in-memory session data (for forking unsaved sessions).
(newName string, sd *SessionData)
| 343 | |
| 344 | // ForkCurrentToNew creates a fork from in-memory session data (for forking unsaved sessions). |
| 345 | func (sm *SessionManager) ForkCurrentToNew(newName string, sd *SessionData) error { |
| 346 | if newName == "" { |
| 347 | return fmt.Errorf("target session name required") |
| 348 | } |
| 349 | |
| 350 | targetPath := sm.getSessionPath(newName) |
| 351 | if _, err := os.Stat(targetPath); err == nil { |
| 352 | return fmt.Errorf("sessão '%s' já existe", newName) |
| 353 | } |
| 354 | |
| 355 | return sm.SaveSessionV2(newName, sd) |
| 356 | } |
| 357 | |
| 358 | // DeleteSession apaga um arquivo de sessão. |
| 359 | func (sm *SessionManager) DeleteSession(name string) error { |
no test coverage detected