{"id":43777767,"url":"https://github.com/onozaty/go-customcsv","last_synced_at":"2026-02-05T17:33:26.428Z","repository":{"id":57597157,"uuid":"374384904","full_name":"onozaty/go-customcsv","owner":"onozaty","description":"Customizing the CSV format","archived":false,"fork":false,"pushed_at":"2021-07-10T23:34:26.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-02T05:48:50.542Z","etag":null,"topics":["csv","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onozaty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"onozaty"}},"created_at":"2021-06-06T14:44:09.000Z","updated_at":"2022-12-13T11:17:25.000Z","dependencies_parsed_at":"2022-08-25T01:41:10.196Z","dependency_job_id":null,"html_url":"https://github.com/onozaty/go-customcsv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/onozaty/go-customcsv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onozaty%2Fgo-customcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onozaty%2Fgo-customcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onozaty%2Fgo-customcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onozaty%2Fgo-customcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onozaty","download_url":"https://codeload.github.com/onozaty/go-customcsv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onozaty%2Fgo-customcsv/sbom","scorecard":{"id":707646,"data":{"date":"2025-08-11","repo":{"name":"github.com/onozaty/go-customcsv","commit":"09be466f4c6d33e9f8c0a314956ab50d5e052266"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/onozaty/go-customcsv/test.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/onozaty/go-customcsv/test.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/onozaty/go-customcsv/test.yaml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T07:09:48.165Z","repository_id":57597157,"created_at":"2025-08-22T07:09:48.165Z","updated_at":"2025-08-22T07:09:48.165Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29127070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T17:12:17.649Z","status":"ssl_error","status_checked_at":"2026-02-05T17:11:23.670Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","go","golang"],"created_at":"2026-02-05T17:33:25.658Z","updated_at":"2026-02-05T17:33:26.423Z","avatar_url":"https://github.com/onozaty.png","language":"Go","funding_links":["https://github.com/sponsors/onozaty"],"categories":[],"sub_categories":[],"readme":"# go-customcsv\r\n\r\n[![Go Reference](https://pkg.go.dev/badge/github.com/onozaty/go-customcsv.svg)](https://pkg.go.dev/github.com/onozaty/go-customcsv)\r\n[![Test](https://github.com/onozaty/go-customcsv/actions/workflows/test.yaml/badge.svg)](https://github.com/onozaty/go-customcsv/actions/workflows/test.yaml)\r\n[![codecov](https://codecov.io/gh/onozaty/go-customcsv/branch/main/graph/badge.svg?token=IRIHJ7E2CM)](https://codecov.io/gh/onozaty/go-customcsv)\r\n\r\nThis is a library for customizing the CSV format.\r\n\r\nYou can customize the following.\r\n\r\n* (Reader/Writer) Format characters\r\n    * Delimiter (default: `,`)\r\n    * Quote (default: `\"`)\r\n    * Record separator (default: `\\r\\n`)\r\n* (Writer) Always quote (default: `false`)\r\n* (Reader) Verify the number of fields per record (default: Check by the number of fields in the first record)\r\n\r\nIn Reader, the head BOM will be automatically skipped.\r\n\r\n## Usage\r\n\r\n### Reader\r\n\r\n```go\r\nf, err := os.Open(\"input.csv\")\r\nif err != nil {\r\n\treturn err\r\n}\r\n\r\nr := customcsv.NewReader(f)\r\n\r\nfor {\r\n\trecord, err := r.Read()\r\n\tif err == io.EOF {\r\n\t\tbreak\r\n\t}\r\n\tif err != nil {\r\n    \treturn err\r\n\t}\r\n\r\n    fmt.Println(record)\r\n}\r\n```\r\n\r\nIn `Reader`, the following items can be customized.\r\n\r\n```go\r\ntype Reader struct {\r\n\t// Delimiter is the field delimiter.\r\n\t// It is set to default comma (',') by NewReader.\r\n\tDelimiter rune\r\n\r\n\t// Quote is the field quote character.\r\n\t// It is set to default double quote ('\"') by NewReader.\r\n\tQuote rune\r\n\r\n\t// SpecialRecordSeparator is the special record separator.\r\n\t// If not specified, a newline ('\\n' '\\r' '\\r\\n') will be used as the record separator.\r\n\tSpecialRecordSeparator string\r\n\r\n\t// FieldsPerRecord is the number of expected fields per record.\r\n\t// FieldsPerRecord \u003e 0 : Checks for the specified value.\r\n\t// FieldsPerRecord = 0 : Check by the number of fields in the first record.\r\n\t// FieldsPerRecord \u003c 0 : No check.\r\n\tFieldsPerRecord int\r\n}\r\n```\r\n\r\nSet this after `NewReader()`.\r\n\r\n```go\r\nr := customcsv.NewReader(f)\r\n\r\n// Customize format\r\nr.Delimiter = ';'\r\nr.SpecialRecordSeparator = \"|\"\r\n```\r\n\r\n### Writer\r\n\r\n```go\r\nf, err := os.Create(\"output.csv\")\r\nif err != nil {\r\n\treturn err\r\n}\r\n\r\nw := customcsv.NewWriter(f)\r\n\r\nfor _, record := range records {\r\n\tif err := w.Write(record); err != nil {\r\n\t\treturn err\r\n\t}\r\n}\r\n\r\nif err := w.Flush(); err != nil {\r\n\treturn err\r\n}\r\n```\r\n\r\nIn `Writer`, the following items can be customized.\r\n\r\n```go\r\ntype Writer struct {\r\n\t// Delimiter is the field delimiter.\r\n\t// It is set to default comma (',') by NewWriter.\r\n\tDelimiter rune\r\n\r\n\t// Quote is the field quote character.\r\n\t// It is set to default double quote ('\"') by NewWriter.\r\n\tQuote rune\r\n\r\n\t// If True, always quote the fields.\r\n\tAllQuotes bool\r\n\r\n\t// RecordSeparator is the record separator.\r\n\t// It is set to default CRLF ('\\r\\n') by NewWriter.\r\n\tRecordSeparator string\r\n}\r\n```\r\n\r\nSet this after `NewWriter()`.\r\n\r\n```go\r\nw := customcsv.NewWriter(f)\r\n\r\n// Customize format\r\nw.AllQuotes = true\r\nw.RecordSeparator = \"\\n\"\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Author\r\n\r\n[onozaty](https://github.com/onozaty)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonozaty%2Fgo-customcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonozaty%2Fgo-customcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonozaty%2Fgo-customcsv/lists"}