csv

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package csv provides utilities for CSV file processing and validation. It includes functions for validating CSV headers against expected schemas and other common CSV manipulation tasks.

Example usage:

expectedHeaders := []string{"Name", "Email", "Age"}
actualHeaders := []string{"Name", "Email", "Age", "Phone"}

// Check if all expected headers are present
if csv.ValidateHeaders(expectedHeaders, actualHeaders) {
	fmt.Println("All required headers are present")
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateHeaders

func ValidateHeaders(expectedHeaders []string, headers []string) bool

ValidateHeaders checks if all expected headers are present in the actual headers slice. It returns true if every header in expectedHeaders is found in headers, false otherwise. The order of headers does not matter, and headers can contain additional columns beyond those specified in expectedHeaders.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL