()
| 11 | } |
| 12 | |
| 13 | func (a *IAccounts) Get() *groq.Account { |
| 14 | a.mx.Lock() |
| 15 | defer a.mx.Unlock() |
| 16 | if len(a.Accounts) == 0 { |
| 17 | return nil |
| 18 | } |
| 19 | account := a.Accounts[0] |
| 20 | a.Accounts = append(a.Accounts[1:], account) |
| 21 | return account |
| 22 | } |
| 23 | |
| 24 | func NewAccounts(accounts []*groq.Account) *IAccounts { |
| 25 | return &IAccounts{Accounts: accounts} |
no outgoing calls
no test coverage detected