Order of arguments of functions or methods should generally apply following rules (from left to right):
- More important to less important.
- Simple types to complicated types.
- Same types should be put together whenever possible.
In the following declaration, type User
is more complicated than type string
, but Repository
belongs to User
, so User
is more left than Repository
.
func IsRepositoryExist(user *User, repoName string) (bool, error) { ...