This is what you have:
func (suite *facesTestSuite) TestShouldNotReveal() {
var (
actual = &user{
Email: "foo&bar.com",
Password: "123",
unexportedField: "Foo",
}
expected = actual
)
Reveal(actual, "private")
assert.Equal(suite.T(), expected, actual)
}
and this is how it should be done:
func (suite *facesTestSuite) TestShouldNotReveal() {
var (
actual = &user{
Email: "foo&bar.com",
Password: "123",
unexportedField: "Foo",
}
expected = actual
)
Reveal(actual, "private")
suite.assert.Equal(expected, actual)
}
and... why fill the vars like that (with the var() around them?)
you have:
var (
actual = &user{
Email: "foo&bar.com",
Password: "123",
unexportedField: "Foo",
}
expected = actual
)
but you can do:
actual := &user{
Email: "foo&bar.com",
Password: "123",
unexportedField: "Foo",
}
expected := actual
Less lines and less indentations, which makes it easier to read
Just my 2 cents....
This is what you have:
and this is how it should be done:
and... why fill the vars like that (with the var() around them?)
you have:
but you can do:
Less lines and less indentations, which makes it easier to read
Just my 2 cents....