To test on Golang, follow these steps:

  • Create a file and end it with _test.go.
  • This file should contain the TestXxx functions as described.
  • Now, put this file in the same package as the one which is being tested.
  • This file will now be included in the “go test” command.
BY Best Interview Question ON 11 Mar 2020