func/templates
salaboy b97fe9c4ec
Adding sample function in go template (#840)
* adding sample function in go template

* adding simple echo, using the correct signature

* fixing readme
2022-03-01 07:38:42 -08:00
..
go Adding sample function in go template (#840) 2022-03-01 07:38:42 -08:00
node fix: minor typos in docs (#862) 2022-02-23 07:25:39 -08:00
python chore: update manifest.yamls (#846) 2022-02-22 09:10:04 -08:00
quarkus chore: update boson builder image references (#810) 2022-02-02 05:06:33 -08:00
rust chore: update manifest.yamls (#846) 2022-02-22 09:10:04 -08:00
springboot chore: update manifest.yamls (#846) 2022-02-22 09:10:04 -08:00
typescript fix: minor typos in docs (#862) 2022-02-23 07:25:39 -08:00
README.md
manifest.yaml feat: add support for manifest.yaml at repo/language/template levels (#558) 2021-10-27 07:09:01 -07:00

README.md

Templates

Packaging

When updates are made to these templates, they must be packaged (serialized as a Go struture) by running make, and checking in the resultant pkged.go file.

How it works

running make in turn installs the pkger binary, which can be installed via: go get github.com/markbates/pkger/cmd/pkger Make then invokes pkger before go build.

The resulting pkged.go file includes the contents of the templates directory, encoded as a Go strucutres which is then makde available in code using an API similar to the standard library's os package.

Rationale

Until such time as embedding static assets in binaries is included in the base go build functionality (see https://github.com/golang/go/issues/35950) a third-party tool is required and pkger provides an API very similar
to the os package.