Skip to content

Commit

Permalink
Fix main
Browse files Browse the repository at this point in the history
  • Loading branch information
caike committed Nov 5, 2019
1 parent ae42270 commit 4121da1
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,32 @@ import (
"time"
)

var months = []time.Month{
time.January,
time.February,
time.March,
time.April,
time.May,
time.June,
time.July,
time.August,
time.September,
time.October,
time.November,
time.December,
time.January,
}

func main() {
bu, _ := m2.CreateBudget(time.January, 1000)
bu.AddItem("bananas", 10.0)

fmt.Println("Items in January:", len(bu.Items))
fmt.Printf("Current cost for January: $%.2f \n", bu.CurrentCost())

bu2, _ := m2.CreateBudget(time.February, 1000)
m2.CreateBudget(time.February, 1000)

bu2 := m2.GetBudget(time.February)
bu2.AddItem("bananas", 10.0)
bu2.AddItem("coffee", 3.99)
bu2.AddItem("gym", 50.0)
Expand All @@ -24,22 +42,6 @@ func main() {
fmt.Println("Resetting Budget Report...")
m2.InitializeReport()

var months = []time.Month{
time.January,
time.January,
time.February,
time.March,
time.April,
time.May,
time.June,
time.July,
time.August,
time.September,
time.October,
time.November,
time.December,
}

for _, month := range months {
_, err := m2.CreateBudget(month, 100.00)
if err == nil {
Expand Down

0 comments on commit 4121da1

Please sign in to comment.