github.com/coveo/gotemplate@v2.7.7+incompatible/template/options.go (about)

     1  package template
     2  
     3  // OptionsSet represents the map of enabled options
     4  type OptionsSet map[Options]bool
     5  
     6  // Options defines the type that hold the various options & libraries that should be included
     7  type Options int
     8  
     9  // Options values
    10  const (
    11  	Razor Options = iota
    12  	Extension
    13  	Math
    14  	Sprig
    15  	Data
    16  	Logging
    17  	Runtime
    18  	Utils
    19  	Net
    20  	OS
    21  	OptionOnByDefaultCount // Trigger of options that are on by default
    22  	Overwrite
    23  	OutputStdout
    24  	RenderingDisabled
    25  	AcceptNoValue
    26  	StrictErrorCheck
    27  )
    28  
    29  // DefaultOptions returns a OptionsSet with the first options turned on by default
    30  func DefaultOptions() OptionsSet {
    31  	os := make(OptionsSet)
    32  	for i := Options(0); i < OptionOnByDefaultCount; i++ {
    33  		os[i] = true
    34  	}
    35  	return os
    36  }
    37  
    38  //go:generate stringer -type=Options -output generated_options.go