Front it will return the front value
()
| 41 | |
| 42 | // Front it will return the front value |
| 43 | func (lq *LQueue) Front() (any, error) { |
| 44 | if !lq.Empty() { |
| 45 | val := lq.queue.Front().Value |
| 46 | return val, nil |
| 47 | } |
| 48 | |
| 49 | return "", fmt.Errorf("error queue is empty") |
| 50 | } |
| 51 | |
| 52 | // Back it will return the back value |
| 53 | func (lq *LQueue) Back() (any, error) { |