Answer the question
In order to leave comments, you need to log in
How to write tests in GO?
How to properly test such a controller? Replace hard binding with an interface, and create your own struct with a method to return the user?
type Controller struct {
authManager *auth.AuthManager
}
type AuthManager struct {
AB *authboss.Authboss
}
func (a AuthManager) GetAuthUser(r *http.Request) *models.User {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question