func (s *Slip) Done(description string) {
	currentTime := timeNow()
	if s.Status == status.Started() {
		s.Worked += currentTime - s.Modified
		s.Finished = currentTime
		s.Modified = currentTime
	} else {
		s.Finished = s.Modified
	}
	s.Description = description
	s.Status = status.Completed()
}
Done marks a timeslip as completed.
package timeslip
import (
	"encoding/json"
	"fmt"
	"strings"
	"time"
	"github.com/google/uuid"
	"github.com/mrcook/time_warrior/timeslip/status"
	"github.com/mrcook/time_warrior/timeslip/worked"
)
type Slip struct {
	Project     string `json:"project"`
	Task        string `json:"task"`
	Description string `json:"description"`
	Started     int    `json:"started"`
	Worked      int    `json:"worked"`
	Finished    int    `json:"finished"`
	Modified    int    `json:"modified"`
	Status      string `json:"status"`
	UUID        string `json:"uuid"`
}
func New(name string) (*Slip, error) {
	currentTime := int(time.Now().Unix())
	project, task, err := parseProjectName(name)
	if err != nil {
		return nil, err
	}
	slip := &Slip{
		Project:     project,
		Task:        task,
		Description: "New Timeslip",
		Started:     currentTime,
		Modified:    currentTime,
		Status:      status.Started(),
		UUID:        uuid.New().String(),
	}
	return slip, nil
}
func Unmarshal(data []byte, slip *Slip) error {
	return json.Unmarshal(data, slip)
}
func (s *Slip) Pause() error {
	if s.isPaused() {
		return fmt.Errorf("slip is already paused")
	}
	s.Status = status.Paused()
	s.Worked += timeNow() - s.Modified
	s.Modified = timeNow()
	return nil
}
func (s Slip) isPaused() bool {
	return s.Status == status.Paused()
}
func (s *Slip) Resume() error {
	if s.Status == status.Started() {
		return fmt.Errorf("slip is already in progress")
	}
	s.Status = status.Started()
	s.Modified = timeNow()
	return nil
}