Created
August 11, 2023 21:13
-
-
Save avneesh91/38c5169e0426a100551d227688c5873d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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