Skip to content

remove dead packr code, tools.go, cmd/template, Makefile targets#3787

Open
ntner wants to merge 1 commit intomasterfrom
rm-packr
Open

remove dead packr code, tools.go, cmd/template, Makefile targets#3787
ntner wants to merge 1 commit intomasterfrom
rm-packr

Conversation

@ntner
Copy link
Copy Markdown
Contributor

@ntner ntner commented Mar 31, 2026

Summary

  • Remove entirely unused packr dependency and all dead code that referenced it
  • Delete 365 files (56k+ lines), mostly vendored transitive dependencies

Details

Packr (github.com/gobuffalo/packr) was completely unused at runtime. The rack loads CloudFormation templates directly from the filesystem via template.New(file).ParseFiles(path) in template.go:157, with no packr involvement. The Dockerfile copies template files into the image.

Dead code removed:

  • pkg/templater/templater.go — used packr.Box but had zero callers (no file imports this package)
  • tools.go — sole content was _ "github.com/gobuffalo/packr/packr" build tool import
  • cmd/template/main.go — dead code with an empty switch statement
  • Makefile — removed package: target (ran packr), clean-package: target (deleted never-generated *-packr.go files), and package dependency from release-cli:, release-image:, and release-provider: targets

Vendored dependencies removed (transitive from packr): BurntSushi/toml, gobuffalo/buffalo-plugins, gobuffalo/envy, gobuffalo/events, gobuffalo/flect, gobuffalo/genny, gobuffalo/logger, gobuffalo/mapi, gobuffalo/meta, gobuffalo/packd, gobuffalo/packr, gobuffalo/syncx, inconshreveable/mousetrap, joho/godotenv, karrick/godirwalk, markbates/oncer, markbates/safe, rogpeppe/go-internal, spf13/cobra, and portions of golang.org/x/mod and golang.org/x/tools.

Backward Compatibility

No runtime code paths are affected. Template loading uses filesystem reads, not packr. The package Makefile target was only a dependency of release-cli, release-image, and release-provider — it ran packr to embed assets that were never actually used at runtime.

@ntner ntner requested a review from nightfury1204 March 31, 2026 00:23
ntner added a commit that referenced this pull request Mar 31, 2026
## Summary
- Remove entirely unused packr dependency and all dead code that referenced it
- Delete 365 files (56k+ lines), mostly vendored transitive dependencies

## Details
Packr (`github.com/gobuffalo/packr`) was completely unused at runtime. The rack loads CloudFormation templates directly from the filesystem via `template.New(file).ParseFiles(path)` in `template.go:157`, with no packr involvement. The Dockerfile copies template files into the image.

Dead code removed:
- `pkg/templater/templater.go` — used `packr.Box` but had zero callers (no file imports this package)
- `tools.go` — sole content was `_ "github.com/gobuffalo/packr/packr"` build tool import
- `cmd/template/main.go` — dead code with an empty switch statement
- `Makefile` — removed `package:` target (ran packr), `clean-package:` target (deleted never-generated `*-packr.go` files), and `package` dependency from `release-cli:`, `release-image:`, and `release-provider:` targets

Vendored dependencies removed (transitive from packr): BurntSushi/toml, gobuffalo/buffalo-plugins, gobuffalo/envy, gobuffalo/events, gobuffalo/flect, gobuffalo/genny, gobuffalo/logger, gobuffalo/mapi, gobuffalo/meta, gobuffalo/packd, gobuffalo/packr, gobuffalo/syncx, inconshreveable/mousetrap, joho/godotenv, karrick/godirwalk, markbates/oncer, markbates/safe, rogpeppe/go-internal, spf13/cobra, and portions of golang.org/x/mod and golang.org/x/tools.

## Backward Compatibility
No runtime code paths are affected. Template loading uses filesystem reads, not packr. The `package` Makefile target was only a dependency of `release-cli`, `release-image`, and `release-provider` — it ran packr to embed assets that were never actually used at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant