{"id":17671248,"url":"https://github.com/stevenferrer/gread","last_synced_at":"2026-01-12T02:45:09.470Z","repository":{"id":57534390,"uuid":"112070260","full_name":"stevenferrer/gread","owner":"stevenferrer","description":"A library for reading and parsing inputs.","archived":false,"fork":false,"pushed_at":"2021-11-04T00:59:54.000Z","size":27,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T13:37:22.670Z","etag":null,"topics":["go","golang","gread","input","reader","scanner"],"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/stevenferrer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-26T09:24:14.000Z","updated_at":"2021-11-04T00:59:40.000Z","dependencies_parsed_at":"2022-09-15T05:23:04.184Z","dependency_job_id":null,"html_url":"https://github.com/stevenferrer/gread","commit_stats":null,"previous_names":["steven-ferrer/gonsole","sf9v/gread","steven-ferrer/gread"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenferrer%2Fgread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenferrer%2Fgread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenferrer%2Fgread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenferrer%2Fgread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenferrer","download_url":"https://codeload.github.com/stevenferrer/gread/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766842,"owners_count":21961004,"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":["go","golang","gread","input","reader","scanner"],"created_at":"2024-10-24T03:13:39.092Z","updated_at":"2026-01-12T02:45:09.430Z","avatar_url":"https://github.com/stevenferrer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gread [![godocs](https://godoc.org/github.com/stevenferrer/gread?status.svg)](https://godoc.org/github.com/stevenferrer/gread) ![Github Actions](https://github.com/stevenferrer/gread/workflows/test/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/stevenferrer/gread/badge.svg?branch=main)](https://coveralls.io/github/stevenferrer/gread?branch=main) [![Go Report Card](https://goreportcard.com/badge/github.com/stevenferrer/gread)](https://goreportcard.com/report/github.com/stevenferrer/gread) [![Sourcegraph](https://sourcegraph.com/github.com/stevenferrer/gread/-/badge.svg)](https://sourcegraph.com/github.com/stevenferrer/gread?badge)\n\n\nGo module for reading from anything that implements `io.Reader`\n\n## Installing\n\n```console\n$ go get github.com/stevenferrer/gread\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"math\"\n    \"strings\"\n\n    \"github.com/stevenferrer/gread\"\n)\n\nfunc main() {\n    s := fmt.Sprintf(\"%v %d %v %v %v %v\\nanother line\\nhello\",\n        math.MaxInt32,\n        math.MaxInt64,\n        math.MaxUint32,\n        uint64(math.MaxUint64),\n        math.MaxFloat32,\n        math.MaxFloat64,\n    )\n    \n    // Create a new `gread.Reader`\n    reader := gread.NewReader(strings.NewReader(s))\n    \n    i32, err := reader.NextInt32()\n    checkErr(err)\n    fmt.Printf(\"%T is %d\\n\\n\", i32, i32)\n\n    i64, err := reader.NextInt64()\n    checkErr(err)\n    fmt.Printf(\"%T is %d\\n\\n\", i64, i64)\n\n    ui32, err := reader.NextUint32()\n    checkErr(err)\n    fmt.Printf(\"%T is %d\\n\\n\", ui32, ui32)\n\n    ui64, err := reader.NextUint64()\n    checkErr(err)\n    fmt.Printf(\"%T is %d\\n\\n\", ui64, ui64)\n\n    f32, err := reader.NextFloat32()\n    checkErr(err)\n    fmt.Printf(\"%T is %f\\n\\n\", f32, f32)\n\n    f64, err := reader.NextFloat64()\n    checkErr(err)\n    fmt.Printf(\"%T is %f\\n\", f64, f64)\n\n    w, err := reader.NextWord()\n    checkErr(err)\n    fmt.Printf(\"\\nword1 is %q\\n\", w)\n    w, err = reader.NextWord()\n    checkErr(err)\n    fmt.Printf(\"word2 is %q\\n\", w)\n\n    l, err := reader.NextLine()\n    checkErr(err)\n    fmt.Printf(\"\\nline is %q\\n\", l)\n}\n\nfunc checkErr(err error) {\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n## Contributing\n\nPlease feel free to improve this by **openning an issue** or **submitting a PR**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenferrer%2Fgread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenferrer%2Fgread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenferrer%2Fgread/lists"}