MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / getRequiredField

Function getRequiredField

internal/files/files.go:448–457  ·  view source on GitHub ↗
(record []string, columnMap map[string]int, field string)

Source from the content-addressed store, hash-verified

446}
447
448func getRequiredField(record []string, columnMap map[string]int, field string) (string, error) {
449 if index, exists := columnMap[field]; exists && index < len(record) {
450 value := strings.TrimSpace(record[index])
451 if value == "" {
452 return "", fmt.Errorf("required field '%s' is empty", field)
453 }
454 return value, nil
455 }
456 return "", fmt.Errorf("required field '%s' not found in record", field)
457}
458
459// ProcessJSON now uses batch processing
460func ProcessJSON(ctx context.Context, uploadID, source string, reader io.Reader, store StoreFunc) (int, error) {

Callers 1

parseExternalTransactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected