blob: 4fb881656a14449202742ab44a2bf9ad3c8eadc8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package main
type Ingredient struct {
Name string
Amount float64
Unit string
}
type Step struct {
Num int
Desc string
Time int
}
type Recipe struct {
Id int
Title string
Desc string
Photos []string
Serving_size int
Cook_time int
Rating int
Keywords []string
Ingredients []Ingredient
Steps []Step
}
func MakeRecipe() *Recipe {
var r Recipe
r = Recipe{
Id: 0,
Title: "",
Desc: "",
Serving_size: 0,
Cook_time: 0,
Rating: 5,
Keywords: make([]string, 0),
Ingredients: make([]Ingredient, 0),
Steps: make([]Step, 0)}
return &r
}
|