Answer by kostya for Testing constructors in Go
In addition to what @bjarke-ebert said.There are no constructors in Go, they are just normal functions. Test them as you would test any other function. If a function is too complex to test then...
View ArticleAnswer by Bjarke Ebert for Testing constructors in Go
Some code is so short and simple that ensuring that the test is correct is more complicated than ensuring that the code itself is correct. Your constructor is such code.What I would do is either not...
View ArticleTesting constructors in Go
How I can test my NewClient constructor for my Client struct ?package busybusimport ("bufio""net")type Client struct { counter integer conn net.Conn bufin *bufio.Reader bufout *bufio.Writer messages...
View Article
More Pages to Explore .....