go-csv

The go-csv package aims to provide easy CSV

  • Reader
  • Writer
  • Sanitizer
  • Unsanitizer
  • StringMapper

codecov goreport Security Rating Bugs Vulnerabilities Maintainability Rating

Installation

go install github.com/sabitaneupane/[email protected]

Requirement

Go 1.18+

Writer

type CSVData struct {
	Headers []string   `json:"headers"`
	Body    [][]string `json:"body"`
}
func Writer(filename string, data CSVData, hasHeader bool) (err error) {}

Reader

type CSVData struct {
	Headers []string   `json:"headers"`
	Body    [][]string `json:"body"`
}
func Reader(filename string, hasHeader bool) (data CSVData, err error) {}

Sanitizer

func Sanitizer(text string) (sanitizedText string) {}

Unsanitizer

func Unsanitizer(text string) (unSanitizedText string) {}

StringMapper

type CSVData struct {
	Headers []string   `json:"headers"`
	Body    [][]string `json:"body"`
}
func StringMapper(data CSVData, hasHeader bool) (content string) {}

GitHub

View Github