Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
scanner := bufio.NewScanner(os.Stdin)
fmt.Println("Enter the ID of the employee: ")
scanner.Scan()
inputID := scanner.Text()
fmt.Println("Enter the name of the employee: ")
scanner.Scan()
inputName := scanner.Text()
fmt.Println("Enter the salary of the employee: ")
scanner.Scan()
inputSalary := scanner.Text()
// Create a struct instance and assign the input values to the corresponding fields
employeeObject := SampleStruct{ID: inputID, Name: inputName, Salary: inputSalary}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment