You could use a for
loop to print the []Project
as shown in @VonC excellent answer.
package main
import "fmt"
type Project struct{ name string }
func main() {
projects := []Project{{"p1"}, {"p2"}}
for i := range projects {
p := projects[i]
fmt.Println(p.name) //p1, p2
}
}