sortedInstances converts a map keyed by ID into a sorted slice.
(raw map[string]Instance)
| 173 | |
| 174 | // sortedInstances converts a map keyed by ID into a sorted slice. |
| 175 | func sortedInstances(raw map[string]Instance) []Instance { |
| 176 | instances := make([]Instance, 0, len(raw)) |
| 177 | for id, inst := range raw { |
| 178 | inst.ID = id |
| 179 | instances = append(instances, inst) |
| 180 | } |
| 181 | sort.Slice(instances, func(i, j int) bool { |
| 182 | return instances[i].ID < instances[j].ID |
| 183 | }) |
| 184 | return instances |
| 185 | } |
| 186 | |
| 187 | func (c *Client) ValidateToken(ctx context.Context) (*ValidateTokenResult, error) { |
| 188 | var result ValidateTokenResult |
no outgoing calls
no test coverage detected