gator/internal/executors/reset.go
Dan Anglin 15386cdb9f
refactor: move executorfunc map
Move the executorFunc map to internal/executors.
2024-10-03 03:37:52 +01:00

18 lines
375 B
Go

package executors
import (
"context"
"fmt"
"codeflow.dananglin.me.uk/apollo/gator/internal/state"
)
func reset(s *state.State, _ executor) error {
if err := s.DB.DeleteAllUsers(context.Background()); err != nil {
fmt.Errorf("unable to delete the users from the database: %w", err)
}
fmt.Println("Successfully removed all users from the database.")
return nil
}