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
In my code, there are some private interfaces that should only be accessed within the current package. However, when I use gomock to generate mock code, other packages can call NewmockXXX to create a mock of those interfaces, which is not what we expect. I would like to achieve a functionality similar to the following:
...
private = flag.Bool("private", false, "Generate private constructor functions for all mocks")
...
...
newStr := "New"
if *private {
newStr = "new"
}
g.p("// "+newStr+"%v creates a new mock instance.", mockType)
g.p("func "+newStr+"%v%v(ctrl *gomock.Controller) *%v%v {", mockType, longTp, mockType, shortTp)
g.in()
...
The text was updated successfully, but these errors were encountered:
In my code, there are some private interfaces that should only be accessed within the current package. However, when I use gomock to generate mock code, other packages can call NewmockXXX to create a mock of those interfaces, which is not what we expect. I would like to achieve a functionality similar to the following:
The text was updated successfully, but these errors were encountered: