logo-MindMajix
PostGoLangGoLang
s
sri kanth

Posted on 21st July 2024|60 views

0
votes

Golang Test Setup

How can I do a test setup by the test package in Golang?

Is there any possible way to do entire test setup processing that is available for every test when utilizing the test package.

Example:

[TestFixture] 

public class SuccessTests { 

[SetUp] public void Init()

 { /* Loads the test data */ } }

 

1 answers
Answers
P
Aryan Sharma

Posted on 21st July 2024| views

This can be accomplished by placing a init() function within the _test.go file. That will be run ere the init() function. 

package main

 func init() 

{ /* loads the test data */ }

 

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number