comment

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Move

func Move(key, val *yaml.Node)

Move moves a comment between yaml.Node entries after a style change. When a yaml.MappingNode or yaml.SequenceNode has an inline comment, the decoder will set LineComment differently according to the node's style.

When value(s) are on a single line (flow style), LineComment will be set on the value. When value(s) are on multiple lines (block style), LineComment will be set on the key.

If templating changes the node's style, the comment needs to move or else encoding errors will occur.

Types

type Tag

type Tag string
var (
	DynamicTag Tag = ""
	BoolTag    Tag = "bool"
	StrTag     Tag = "str"
	IntTag     Tag = "int"
	FloatTag   Tag = "float"
	SeqTag     Tag = "seq"
	MapTag     Tag = "map"
)

func Parse

func Parse(prefix string, n *yaml.Node) (string, Tag)

Parse returns the template and tag from a yaml.Node LineComment

func (Tag) ToYaml

func (t Tag) ToYaml() string

Jump to

Keyboard shortcuts

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