placeholder

package
v2.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package placeholder fills {{name}}, {{name|default}} and date offset {{name+N}} variable placeholders in JSON documents, escaping each value so a filled document stays valid JSON

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONStringContent

func JSONStringContent(value string) string

JSONStringContent escapes value for use inside a JSON string, so a filled value cannot break the document it lands in

Types

type Variables

type Variables map[string]string

Variables are the values that fill {{name}}, {{name+N}} and {{name|default}} placeholders

func (Variables) Fill

func (v Variables) Fill(doc string) string

Fill replaces every placeholder in doc with the variable's value escaped for a JSON string, moved by the placeholder's day offset when it has one, or its default when unset, leaving an unset placeholder without a default unchanged

func (Variables) With

func (v Variables) With(overrides Variables) Variables

With returns the variables with overrides layered on top, leaving both inputs unchanged

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL