• Kyle Clarke's avatar
    Parse/load templates from filepath in parallel · c9ac7db3
    Kyle Clarke authored
    In the spirit of using go with parallalism, the template file loader now
    uses goroutines, wait groups and channels to parse/load templates.
    Although the performance benefit personally is slight, it did highlight
    that other users of this lib would have issues with the default loader
    struct not having a sync.Mutex available. Required when parsing in
    This also meant it was prudent to add a timeout on load so that an error
    is returned if unexpected time to load. Because this package is used for
    me personally in a private repo, I also had to create the go mod file so
    that it could be referred to locally easily with the replace directive.
    A new test was made and the readme updated with the new options.
README.md 13.9 KB