{"id":34134444,"url":"https://github.com/bbrodriges/bundle","last_synced_at":"2026-03-12T13:33:32.080Z","repository":{"id":57544920,"uuid":"145372179","full_name":"bbrodriges/bundle","owner":"bbrodriges","description":"Bundle merges multiple Go source files into single one","archived":false,"fork":false,"pushed_at":"2018-08-23T07:12:33.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T12:37:41.817Z","etag":null,"topics":["bundling","golang","source-code"],"latest_commit_sha":null,"homepage":null,"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/bbrodriges.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":"2018-08-20T05:54:04.000Z","updated_at":"2018-10-26T15:00:57.000Z","dependencies_parsed_at":"2022-08-27T05:21:06.188Z","dependency_job_id":null,"html_url":"https://github.com/bbrodriges/bundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bbrodriges/bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrodriges%2Fbundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrodriges%2Fbundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrodriges%2Fbundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrodriges%2Fbundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbrodriges","download_url":"https://codeload.github.com/bbrodriges/bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrodriges%2Fbundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30427339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T12:46:33.731Z","status":"ssl_error","status_checked_at":"2026-03-12T12:42:20.405Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["bundling","golang","source-code"],"created_at":"2025-12-15T01:23:32.925Z","updated_at":"2026-03-12T13:33:32.073Z","avatar_url":"https://github.com/bbrodriges.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bundle\nBundle merges multiple Go source files into single one.\n\n# Install\n\n```\ngo get -u github.com/bbrodriges/bundle\n```\n\n# Usage\n\nAs a separate command:\n\n```\n$ bundle --help\nUsage: bundle -p \u003cpackage_name\u003e [-d] pattern...\nAvailable options:\n  -d\tDelete source files after bundling\n  -p string\n    \tPackage name to be written into result file. Required\n\n$ bundle -d -p main *_gen.go \u003e bundle.go # bundle all autogenerated files in current folder\n$ bundle -d -p main -o bundle.go user.msgp.go user.str.go # bundle only specific files\n```\n\nAs a `go generate` flag:\n\n```go\npackage types\n\n//go:generate msgp -o=user.msgp.go -tests=false -io=false\n//go:generate stringer -type=User -output=user.str.go -linecomment\n//msgp:shim UserState as:string using:(UserState).String/UserStateFromString\n\n//go:generate bundle -d -p=types -o=user_gen.go user.msgp.go user.str.go\n\ntype User struct {\n    Username string `msg:\"username\"`\n    Email string `msg:\"email\"`\n    State UserState `msg:\"state\"`\n}\n\ntype UserState int\n\nconst (\n    Unknown UserState = iota -1 // UNKNOWN\n    Inactive                    // INACTIVE\n    Active                      // ACTIVE\n    Banned                      // BANNED\n)\n\nfunc UserStateFromString(s string) UserState {\n    switch s {\n    case \"INACTIVE\":\n        return Inactive\n    case \"ACTIVE\":\n        return Active\n    case \"BANNED\":\n        return Banned\n    }\n    return Unknown\n}\n```\n\nThe above code upon calling `go generate .` will:\n1. create files called `user.msgp.go` and `user.str.go` with containing autogenerated code\n2. bundle these two files into single `user_gen.go` and delete source files `user.msgp.go` and `user.str.go`\n\n# Limitations\n\n* bundle cannot handle definition conflicts (e.g. structs, functions, constants of the same names)\n* bundle cannot handle import cycle conflicts\n\nAll it does is collects and strips out import declarations from every given source files AST and concats them into single file with helping comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbrodriges%2Fbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbrodriges%2Fbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbrodriges%2Fbundle/lists"}