{"id":21181411,"url":"https://github.com/rhaseven7h/goembed","last_synced_at":"2025-07-24T11:34:24.749Z","repository":{"id":66511692,"uuid":"370819424","full_name":"rhaseven7h/goembed","owner":"rhaseven7h","description":"GoEmbed generates a file that you may include in your project to include a file's content as code, embedded within the binary.","archived":false,"fork":false,"pushed_at":"2021-05-25T23:01:55.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T08:47:23.243Z","etag":null,"topics":["embed","embed-files","embedfiles","generate","go","go-generate","gogenerate","golang","golang-application","golang-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhaseven7h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-25T20:25:58.000Z","updated_at":"2021-07-27T20:16:15.000Z","dependencies_parsed_at":"2024-06-20T12:57:43.494Z","dependency_job_id":"288fed29-480f-4d86-948f-cdf009c512d4","html_url":"https://github.com/rhaseven7h/goembed","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rhaseven7h/goembed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaseven7h%2Fgoembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaseven7h%2Fgoembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaseven7h%2Fgoembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaseven7h%2Fgoembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaseven7h","download_url":"https://codeload.github.com/rhaseven7h/goembed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaseven7h%2Fgoembed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266834983,"owners_count":23992296,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["embed","embed-files","embedfiles","generate","go","go-generate","gogenerate","golang","golang-application","golang-tools"],"created_at":"2024-11-20T17:50:21.989Z","updated_at":"2025-07-24T11:34:24.702Z","avatar_url":"https://github.com/rhaseven7h.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Embed Generator\n\n## Summary\n\n`goembed` generates a file that you may include in your project to include a file's content as code, embedded within the\nbinary.\n\n## Installation\n\nYou can use `go` tool to install it to you Go home (`$HOME/go/bin`) as `goembed` binary.\n\n```shell\ngo install github.com/rhaseven7h/goembed@latest\n```\n\n## Usage\n\nYou must specify the package name for the generated file, the output path and/or file name, the variable name for the\ngenerated data, and finally, the input file.\n\n```shell\ngoembed \\ \n   -package mypackagename \\\n   -output embeddedfiles/dataone.go \\\n   -variable MyData \\\n   my_input_file.txt\n```\n\nYou may specify `-` for both input and out files, which will use standard input and standard output respectively.\n\n## Output\n\nAn example output for the above command would be the following:\n\n```go\npackage data\n\nimport (\n\t\"encoding/base64\"\n)\n\nvar InitData []byte\n\nfunc init() {\n\tInitData, _ = base64.StdEncoding.DecodeString(\n\t\t\"\" +\n\t\t\t\"ZnVuY3Rpb24gZ3ZtKCkgewogIE9VVFBVVD0kKHNndm0gIiRAIikKICBFWElUX0NP\" +\n\t\t\t\"REU9JD8KICBpZiBbICRFWElUX0NPREUgLW5lIDEgXTsgdGhlbgogICAgZWNobyAk\" +\n\t\t\t\"T1VUUFVUCiAgICByZXR1cm4KICBmaQogIGV2YWwgIiR7T1VUUFVUfSIKfQo=\" +\n\t\t\t\"\",\n\t)\n}\n```\n\nWith this, you may import the `data` package, and use the `data.InitData`\nvariable which will contain the original input contents in a `[]byte` slice.\n\n## Go Generate\n\nYou may use this tool with Go Generate functionality by adding a line as follows to your source code:\n\n```go\n//go:generate goembed -package pkgname -output data/input.go -variable MyData my_input_file.txt\n```\n\n## Copyright\n\nThis work is licensed under\na [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).\n\n![ Creative Commons Attribution-ShareAlike 4.0 International License.](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaseven7h%2Fgoembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaseven7h%2Fgoembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaseven7h%2Fgoembed/lists"}