Quantcast
Channel: Testing constructors in Go - Stack Overflow
Browsing all 3 articles
Browse latest View live

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 Article



Answer 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 Article

Testing 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
Browsing all 3 articles
Browse latest View live




Latest Images