Files
dependabot[bot] 19c1cd2fa2 build(deps): bump the minor-and-patch group across 1 directory with 3 updates (#12728)
Bumps the minor-and-patch group with 3 updates in the / directory: [github.com/gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype), [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) and [github.com/rogpeppe/go-internal](https://github.com/rogpeppe/go-internal).


Updates `github.com/gabriel-vasile/mimetype` from 1.4.13 to 1.4.15
- [Release notes](https://github.com/gabriel-vasile/mimetype/releases)
- [Commits](https://github.com/gabriel-vasile/mimetype/compare/v1.4.13...v1.4.15)

Updates `github.com/open-policy-agent/opa` from 1.18.2 to 1.19.0
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-policy-agent/opa/compare/v1.18.2...v1.19.0)

Updates `github.com/rogpeppe/go-internal` from 1.15.0 to 1.16.0
- [Release notes](https://github.com/rogpeppe/go-internal/releases)
- [Commits](https://github.com/rogpeppe/go-internal/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/gabriel-vasile/mimetype
  dependency-version: 1.4.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: github.com/rogpeppe/go-internal
  dependency-version: 1.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-05 20:31:43 +02:00

1.5 KiB

methodlesstemplate

A vendored copy of the Go standard library's text/template, with one behavioral change: the method-calls-on-data branch in exec.go's evalField (reflect.Value.MethodByName) is removed.

A reachable, non-constant reflect.Value.MethodByName makes the Go linker disable method-level dead-code elimination for the entire binary (golang/go#72895). OPA reaches text/template from its compiler (schema errors) and the strings.render_template builtin, so that one edge retains the full reflected method surface of every embedder — a large binary-size regression (#7903). Rego values and gojsonschema ErrorDetails decode to map[string]any / []any / scalars, which have no methods, so eliding the data-method lookup is a behavioral no-op while restoring DCE.

Only exec.go differs from the upstream stdlib. doc.go, funcs.go, option.go, template.go, and internal/fmtsort/sort.go are byte-identical to their Go release; text/template/parse is reused via its normal import. helper.go (ParseFiles/ParseGlob/ParseFS) is intentionally not vendored. Go's BSD LICENSE and per-file copyright headers are preserved.

Regenerating

Do not hand-edit these files. To re-sync to a new Go release, run under the target toolchain:

GOTOOLCHAIN=go1.26.0 build/regen-methodless-template.sh

The script copies the stdlib files verbatim and re-applies the single method-elision edit. If the edit no longer applies (the stdlib changed that region), the script fails and the elision must be re-derived and the patch in the script updated.