Skip to content

Instantly share code, notes, and snippets.

@avneesh91
Created August 11, 2023 21:13
Show Gist options
  • Save avneesh91/38c5169e0426a100551d227688c5873d to your computer and use it in GitHub Desktop.
Save avneesh91/38c5169e0426a100551d227688c5873d to your computer and use it in GitHub Desktop.
type MyStruct struct {
FirstName string
LastName string
}
func NewMyStruct(firstName string, lastName string) MyStruct{
return MyStruct{
FirstName: firstName,
LastName: lastName
}
}
var myStructList []MyStruct
for i := 1; i <= 10; i++ {
myStructList = append(myStructList, NewMyStruct("testFirstName", "testLastName"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment