{"id":18602962,"url":"https://github.com/cuixin/csv4g","last_synced_at":"2025-04-10T19:31:15.981Z","repository":{"id":12171495,"uuid":"14769939","full_name":"cuixin/csv4g","owner":"cuixin","description":"csv files mapping/unmarshal to struct data in golang.","archived":false,"fork":false,"pushed_at":"2020-03-10T14:41:41.000Z","size":17,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T03:34:06.608Z","etag":null,"topics":["csv","golang","marshal","structure","unmarshall"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuixin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-28T06:51:48.000Z","updated_at":"2021-02-14T10:00:39.000Z","dependencies_parsed_at":"2022-09-05T20:21:00.651Z","dependency_job_id":null,"html_url":"https://github.com/cuixin/csv4g","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixin%2Fcsv4g","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixin%2Fcsv4g/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixin%2Fcsv4g/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixin%2Fcsv4g/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuixin","download_url":"https://codeload.github.com/cuixin/csv4g/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281397,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","golang","marshal","structure","unmarshall"],"created_at":"2024-11-07T02:13:06.644Z","updated_at":"2025-04-10T19:31:14.937Z","avatar_url":"https://github.com/cuixin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"csv4g\n=======\n\nA csv file mapping to struct tool.\n\ninstallation\n------------\n\n    go get github.com/cuixin/csv4g\n\nexample\n-------\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cuixin/csv4g\"\n)\n\ntype Test struct {\n\tId           int\n\tName         string\n\tDesc         string\n\tGo           string\n\tNum          float32\n\tFoo          bool\n\tSliceInt     []int\n\tSliceFloat32 []float32 `csv:\"sliceFloat32\"`\n\tIgnoreField  string    `csv:\"-\"`\n\tCustomField  string    `csv:\"custom,omitempty\"`\n\tEmptyField   string    `csv:\"omitempty\"`\n}\n\nfunc main() {\n\tcsv, err := csv4g.NewWithOpts(\"test.csv\", Test{}, csv4g.Comma(','), csv4g.LazyQuotes(true), csv4g.SkipLine(1))\n\tif err != nil {\n\t\tfmt.Printf(\"Error %v\\n\", err)\n\t\treturn\n\t}\n\tfor i := 0; i \u003c csv.LineLen; i++ {\n\t\ttt := \u0026Test{}\n\t\terr = csv.Parse(tt)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error on parse %v\\n\", err)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(tt)\n\t}\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixin%2Fcsv4g","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuixin%2Fcsv4g","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixin%2Fcsv4g/lists"}