MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / validateDataNotEmpty

Function validateDataNotEmpty

ftv.go:27–39  ·  view source on GitHub ↗

validateDataNotEmpty checks if buffer has data rows and exits if empty

(b *Buffer, source string)

Source from the content-addressed store, hash-verified

25
26// validateDataNotEmpty checks if buffer has data rows and exits if empty
27func 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
42func startAsyncUpdateHandler(updateChan <-chan bool, doneChan <-chan error) {

Callers 2

loadAndDisplayAsyncFunction · 0.85
loadAndDisplaySyncFunction · 0.85

Calls 1

stopViewFunction · 0.85

Tested by

no test coverage detected