diff --git a/go.mod b/go.mod index 8b5015c..77c852a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module example.com/investment-calculator +module example.com/structs -go 1.23.1 +go 1.21.2 diff --git a/structs.go b/structs.go new file mode 100644 index 0000000..b9f5807 --- /dev/null +++ b/structs.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" +) + +func main() { + firstName := getUserData("Please enter your first name: ") + lastName := getUserData("Please enter your last name: ") + birthdate := getUserData("Please enter your birthdate (MM/DD/YYYY): ") + + // ... do something awesome with that gathered data! + + fmt.Println(firstName, lastName, birthdate) +} + +func getUserData(promptText string) string { + fmt.Print(promptText) + var value string + fmt.Scan(&value) + return value +}