validateDataNotEmpty checks if buffer has data rows and exits if empty
(b *Buffer, source string)
| 25 | |
| 26 | // validateDataNotEmpty checks if buffer has data rows and exits if empty |
| 27 | func validateDataNotEmpty(b *Buffer, source string) error { |
| 28 | dataRows := b.rowLen - b.rowFreeze |
| 29 | if b.rowLen == 0 || dataRows <= 0 { |
| 30 | stopView() |
| 31 | if b.rowLen == 0 { |
| 32 | fmt.Printf("⚠️ %s is empty (no rows)\n", source) |
| 33 | } else { |
| 34 | fmt.Printf("⚠️ %s is empty (only header, no data rows)\n", source) |
| 35 | } |
| 36 | os.Exit(0) |
| 37 | } |
| 38 | return nil |
| 39 | } |
| 40 | |
| 41 | // startAsyncUpdateHandler manages UI updates during async loading |
| 42 | func startAsyncUpdateHandler(updateChan <-chan bool, doneChan <-chan error) { |
no test coverage detected