I want to access a method of a struct but without instantiating an empty struct.
So I can do somethiing like models.UserModel.Create() instead of models.UserModel{}.Create()
You can define a variable named User inside that package, and initialize it with init function: func init() { User = UserModel{} }
AFAIK - no.
Обсуждают сегодня