Golint in practice

Report a typo

Let's now create another simple very basic questionnaire project. The program prints the full name of the user, date of birth, and occupation. Below is the code for the project. There are some issues in terms of the style of the code. Use the appropriate tool to find the style mistakes, and fix them. Finally, add the number of modifications that the tool suggested to the last print statement in the code below (change the 0 to the number you've got).

package main

import (
	"fmt"
)

func main() {
	// Enter your firstName:
	var first_name string
	fmt.Scanln(&first_name)
	// Enter your lastName:
	var last_name string
	fmt.Scanln(&last_name)
	// Enter your date of birth in form dd.mm.yyyy:
	var date_of_birth string
	fmt.Scanln(&date_of_birth)
	// Enter your occupation:
	var occupation string
	fmt.Scanln(&occupation)

	fmt.Println("Your full name is " + first_name + " " + last_name)
	fmt.Println("You was born in " + date_of_birth)
	fmt.Println("And you are " + occupation)

	fmt.Println("Number of modifications in the code", 0)
}

Sample Input 1:

John
Doe
01.01.2000
Engineer

Sample Output 1:

Your full name is John Doe
You was born in 01.01.2000
And you are Engineer
Number of modifications in the code 3
Write a program in Go
package main

import (
"fmt"
)

func main() {
// put your code here

}
___

Create a free account to access the full topic