{"id":37100979,"url":"https://github.com/ichiban/assets","last_synced_at":"2026-01-14T12:17:06.943Z","repository":{"id":57499252,"uuid":"156054405","full_name":"ichiban/assets","owner":"ichiban","description":"Go resource embedding library which doesn't require `go generate` at all","archived":false,"fork":false,"pushed_at":"2019-10-03T00:07:21.000Z","size":1537,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T05:53:40.101Z","etag":null,"topics":["go","golang","resource-embedding","static-files","zip"],"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/ichiban.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}},"created_at":"2018-11-04T06:05:05.000Z","updated_at":"2024-01-10T15:00:54.000Z","dependencies_parsed_at":"2022-08-28T14:00:49.453Z","dependency_job_id":null,"html_url":"https://github.com/ichiban/assets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ichiban/assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fassets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fassets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fassets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fassets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ichiban","download_url":"https://codeload.github.com/ichiban/assets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ichiban%2Fassets/sbom","scorecard":{"id":480262,"data":{"date":"2025-08-11","repo":{"name":"github.com/ichiban/assets","commit":"ee62ba703c6eb40617cc79ff84d8c299fd8de689"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Code-Review","score":0,"reason":"Found 0/9 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":"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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-19T16:25:28.909Z","repository_id":57499252,"created_at":"2025-08-19T16:25:28.910Z","updated_at":"2025-08-19T16:25:28.910Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","golang","resource-embedding","static-files","zip"],"created_at":"2026-01-14T12:17:06.227Z","updated_at":"2026-01-14T12:17:06.929Z","avatar_url":"https://github.com/ichiban.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assets\nGo resource embedding library which doesn't require `go generate` at all.\n\n[![GoDoc](https://godoc.org/github.com/ichiban/assets?status.svg)](https://godoc.org/github.com/ichiban/assets)\n[![Build Status](https://travis-ci.org/ichiban/assets.svg?branch=master)](https://travis-ci.org/ichiban/assets)\n\n## Overview\n\n[Resource Embedding in Go](https://awesome-go.com/#resource-embedding) is cumbersome especially when it involves custom commands and `go generate`.\n`assets` is another resource embedding library which doesn't require any of them.\nIt extracts a zip file bundled with your binary and provides a file path to the contents.\n\n## Features\n\n- no custom commands\n- no `go generate`\n- only requires `cat` and `zip` when `go build`\n- uses local files when `go run` or `go test`\n- easily extendable interface\n\n## Getting Started\n\n### Prerequisites\n\nWe assume you have a Go project and a directory named `assets` for resources in the project root.\nThis directory name can be easily configured but for the sake of explanation we call the directory `assets`.\n\n```\n$ tree .\n.\n├── Makefile\n├── assets\n│   └── templates\n│       └── hello.tmpl\n└── main.go\n\n2 directories, 3 files\n``` \n\n### Install\n\nFirst go get the library.\n\n```shell\n$ go get github.com/ichiban/assets\n```\n\nThen import it.\n\n```\nimport \"github.com/ichiban/assets\"\n```\n\n### Usage\n\nIn Go files, we can get the locator which points to `assets` directory by calling `assets.New()`.\nNote that we'll need to close it in the end.\n\n```go\n\tl, err := assets.New()\n\tif err != nil {\n\t\tlog.Fatalf(\"assets.New() failed: %v\", err)\n\t}\n\tdefer l.Close()\n\t\n\tlog.Printf(\"assets: %s\", l.Path)\n```\n\nWhen we build it and bundle with a resource zip file, the locator will point to the contents of the zip file which is extracted into a temporary directory.\n\n### Build\n\nTo start with, we need to build the binary as usual.\n\n```\n$ mkdir -p bin \n$ go build -o bin/hello\n```\n\nThen, zip resources into a zip file.\nWe need to enter `assets` directory to make a proper zip file.\n\n```\n$ mkdir -p zip\n$ cd assets\n$ zip -r ../zip/assets.zip .\n  adding: templates/ (stored 0%)\n  adding: templates/hello.tmpl (stored 0%)\n$ cd ..\n```\n\nA proper zip file looks like this:\n\n```\n$ unzip -l zip/assets.zip \nArchive:  zip/assets.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  11-05-2018 22:31   templates/\n       14  11-05-2018 21:31   templates/hello.tmpl\n---------                     -------\n       14                     2 files\n```\n\nFinally, we can bundle resources by `cat` the binary and the zip file.\nPrepending an executable makes the zip offset values off by the size of the executable.\nWe can fix the offsets by `zip -A` (`zip --adjust-sfx`).\n\n```\n$ cat bin/hello zip/assets.zip \u003e bin/hello-bundled\n$ zip -A bin/hello-bundled \nZip entry offsets appear off by 3345496 bytes - correcting...\n$ chmod +x bin/hello-bundled\n```\n\nInterestingly, the bundled binary is an executable and also a zip file.\n\n```\n$ unzip -l bin/hello-bundled \nArchive:  bin/hello-bundled\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  11-05-2018 22:31   templates/\n       14  11-05-2018 21:31   templates/hello.tmpl\n---------                     -------\n       14                     2 files\n```\n\n```\n$ bin/hello-bundled \n2018/11/30 16:22:13 assets: /var/folders/xt/6z9sk1dx1d734ltxxst16_h00000gn/T/hello-bundled882816570\nHello, World!\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. \n\n## Acknowledgments\n\nThis project is inspired by [Zgok](https://github.com/srtkkou/zgok).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fichiban%2Fassets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fichiban%2Fassets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fichiban%2Fassets/lists"}