You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gostub cannot stub static functions, it can only stub variables.
The typical usage is something like:
// Variable for stubbing
var randomBytesFunc = RandomBytes
func PasswordHash(password string) ([]byte, error) {
// Use the variable for calling the function
return randomBytesFunc(4)
}
And then gostub.Stub(&randomBytesFunc, ...) would replace the variable.
Hi, I am new to GoLang, please pardon me in case this issue turns out to be lame.
Here is what I tried
So basically I am unable to stub the
RandomBytes
function.Reproduced in playground
The text was updated successfully, but these errors were encountered: