I'm looking to add an array for a string variable inside of a struct I have created in Go.
type Recipes struct { //Struct for recipe information
name string
prepTime int
cookTime int
recipeIngredient string
recipeID int
recipeYield int
}
It is called by
Recipe1.name = "BBQ Pulled Chicken"
Recipe1.prepTime = 25
Recipe1.cookTime = 5
Recipe1.recipeIngredient = "1 8-ounce can reduced-sodium tomato sauce, two"
Recipe1.recipeID = 1
Recipe1.recipeYield = 8
recipeIngredient will have multiple ingredients so it just can't be one string. I would like to have multiple array/slice elements inside recipeIngredient. Anyone have an idea on how i would be able to do this please?