summaryrefslogtreecommitdiffstats
path: root/common/maps/scratch_test.go
AgeCommit message (Collapse)Author
2021-05-17common/maps: Add Scratch.DeleteInMapmeehawk
Add Scratch.DeleteInMap method. This method works similar to Scratch.SetInMap. It takes in two string parameters, key and mapKey and deletes the value mapped to mapKey in key Closes #8504
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-05-29common/maps: Add Scratch.ValuesBjørn Erik Pedersen
Fixes #7335
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2018-10-27common/collections: Allow a mix of slice types in append/Scratch.AddBjørn Erik Pedersen
The type handling in these was improved in Hugo 0.49, but this also meant that it was no longer possible to start out with a string slice and later append `Page` etc. to it. This commit makes sure that the old behaviour is now possible again by falling back to a `[]interface{}` as a last resort. Fixes #5361
2018-10-08common/maps: Improve append in ScratchBjørn Erik Pedersen
This commit consolidates the reflective collections handling in `.Scratch` vs the `tpl` package so they use the same code paths. This commit also adds support for a corner case where a typed slice is appended to a nil or empty `[]interface{}`. Fixes #5275
2018-07-06Add a newScratch template funcBjørn Erik Pedersen
Fixes #4685