Help us shape the future of Go! Take the 2026 Go Developer Survey

keypath

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package keypath is the one grammar for config key paths, shared by the config tier that binds keys in a file (extract) and the pick that reads a key out of a remote def's target (pick). Two parsers of the same thing disagreed: the tier read `wfsys:up:` as the key `wfsys:up`, the pick split it at the first colon, so `pick=yaml:tasks.wfsys:up` found nothing while `ds def Taskfile.yml#tasks.wfsys:up` worked (bug 135).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func End

func End(t string, yaml bool) int

End returns where a key ends in the trimmed line t: the first `=`, or the first `:` that ends it, or -1. In YAML that is a colon followed by whitespace or the end of the line, because a colon anywhere else is part of the key -- `wfsys:up:` declares the key `wfsys:up`, which is how every Taskfile names a namespaced task. Other formats keep the first colon, since a Java properties file writes `key:value` with no space.

func Quote

func Quote(k string) string

Quote spells one path segment so the path round-trips: a key that contains the path separator, or a quote, is written quoted.

func Split

func Split(s string) []string

Split is the inverse of the spelling Quote produces: it splits on dots outside quotes and removes the quotes, so `tasks."a.b".desc` is three segments and `tasks.wfsys:up` is two.

func Unquote

func Unquote(k string) string

Unquote removes one pair of matching quotes around a key as written in the file (`"a.b":`), so it compares with a path segment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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