Documentation
¶
Overview ¶
Package templates holds the guest PowerShell scripts shipped by winkit.
Guest scripts live as files under this directory, never as Go raw strings.
PowerShell's escape character is the backtick — the same character that delimits a Go raw string — so a script needing `n, `t or a line continuation cannot be written inline at all. That is not hypothetical: writing `Staged` inside a comment terminated a raw string and broke the build on 2026-07-31. Splicing Go constants also forced scripts to close and reopen their string mid-line, which is how a `"$env:USERNAME:(R)"` interpolation bug survived review. Template fields remove both hazards, and the scripts become syntax-highlightable, greppable files.
Layout: <domain>/<name>.ps1.tmpl — provision/ for build-time provisioning, devenv/ for dev-environment setup, partials/ for shared fragments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render renders a guest script by path relative to this package.
A template that fails to parse or execute is a programming error, not a runtime condition: the data comes from our own config structs, so there is no input a user could supply to trigger it. Panicking keeps every caller's signature free of an error that cannot happen in practice.
Types ¶
This section is empty.