Gofmt in practice

Report a typo

You wanted to create a very simple and easy project quickly. However, as you typed code quickly you made a couple of formatting mistakes. Below is the code snipped of the project. Use the needed tool to check for formatting problems, and select all the lines that will be formated. Please note that empty lines are also counted as a line.

package main

import "fmt"

func main() {
	toPay:=500
	tipPercent :=  20
	people:= 5
	pay :=toPay*(tipPercent/100+1)/people
	fmt.Println("You need to pay", toPay)
	fmt.Println("The tip percentage is", tipPercent)
	fmt.Println("You are", people, "people")
	fmt.Println("So, each one of you need to pay", pay)
	fmt.Println("Number of changes made", 0)
}
Select one or more options from the list
___

Create a free account to access the full topic