func (m *MockProvider) GroupByGID(gid uint32) (*accounts.Group, error) {
	for _, g := range m.Grps {
		if gid == g.GID {
			return g, m.Err
		}
	}
	return nil, accounts.GIDNotFound(gid)
}
GroupByGID satisfies AccountProvider.
package testbase
import "github.com/GoogleCloudPlatform/compute-user-accounts/accounts"
type MockProvider struct {
	Err  error
	Usrs []*accounts.User
	Grps []*accounts.Group
	Nams []string
	Keys map[string][]string
}
func (m *MockProvider) UserByName(name string) (*accounts.User, error) {
	for _, u := range m.Usrs {
		if name == u.Name {
			return u, m.Err
		}
	}
	return nil, accounts.UsernameNotFound(name)
}
func (m *MockProvider) UserByUID(uid uint32) (*accounts.User, error) {
	for _, u := range m.Usrs {
		if uid == u.UID {
			return u, m.Err
		}
	}
	return nil, accounts.UIDNotFound(uid)
}
func (m *MockProvider) Users() ([]*accounts.User, error) {
	return m.Usrs, m.Err
}
func (m *MockProvider) GroupByName(name string) (*accounts.Group, error) {
	for _, g := range m.Grps {
		if name == g.Name {
			return g, m.Err
		}
	}
	return nil, accounts.GroupNameNotFound(name)
}