Answers for "golang before all tests"

Go
0

golang before all tests

This can be achieved by putting a init() function in the myfile_test.go file. This will be run before the init() function.

// myfile_test.go
package main

func init() {
     /* load test data */
}
The myfile_test.init() will be called before the package init() function.
Posted by: Guest on December-28-2020

Browse Popular Code Answers by Language