<file_sep>package main

import (
    "fmt"
    _ "github.com/nativeborncitizen/dm/storage"
)

func main() {
    fmt.Println(`Date&time management system
v. 0.1b`)
}
<file_sep>package storage

import (
    "testing"
    "time"
    "github.com/nativeborncitizen/dm/storage"
)

func TestNewTask(t *testing.T) {
    a := storage.NewTask("AAA")
    if a.GetDesc() != "AAA" {
        t.Error("Expected AAA, got", a.GetDesc())
    }
}

func TestNewTree(t *testing.T) {
    n := time.Now()
    tree := storage.NewTree()
    tree.Add(n, storage.NewTask("AAA"))
    res, ok := tree.Find(n)
    if !ok {
        t.Error("Expected task")    
    }
    if res.GetDesc() != "AAA" {
        t.Error("Expected AAA, got", res.GetDesc())    
    }
}
<file_sep>package storage

import "time"

type timeTree map[time.Time]*task 

var tree timeTree

func NewTree() timeTree {
    return make(timeTree)
}

func (tree timeTree) Add(time time.Time, t *task) {
    tree[time] = t
}

func (tree timeTree) Find(time time.Time) (t *task, ok bool) {
    t, ok = tree[time]
    return
}
<file_sep>package storage

type task struct {
    desc string
}

func NewTask(desc string) *task {
    return &task{desc}
}

func (t task) GetDesc() string {
    return t.desc
}
