Answers for "golang test setup before each"

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

Code answers related to "golang test setup before each"

Browse Popular Code Answers by Language