shared

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClassificationPath

func BuildClassificationPath(project string, includesScope bool, scopeName string, raw string) (string, error)

BuildClassificationPath prepares the path segment for Azure DevOps REST endpoints.

Rules and validations: - Accepts user input with either forward or backward slashes. - Uses the same normalization rules as NormalizeClassificationPath. - If the trimmed input is empty, returns ("", nil) to indicate "no path" (keeps existing callers behavior). - Removes a leading project segment (case-insensitive) if present. - If includesScope is true, removes a leading scopeName segment (case-insensitive) if present after project removal. - Rejects input that would produce empty segments (e.g., "a//b" after normalization should not happen because we collapse slashes). - Trims whitespace around each segment. - URL-escapes each segment with url.PathEscape and joins with forward slashes.

func NormalizeClassificationPath

func NormalizeClassificationPath(raw string) string

NormalizeClassificationPath normalizes classification node paths.

Behavior: - If raw is empty or only whitespace/slashes, returns an empty string. - Converts backslashes to forward slashes. - Trims surrounding whitespace. - Collapses consecutive slashes (e.g. "a//b" -> "a/b"). - Removes any leading and trailing slashes. Examples:

NormalizeClassificationPath("  \\Project\\Area\\Foo\\ ") -> "Project/Area/Foo"
NormalizeClassificationPath("/a//b/") -> "a/b"

Types

This section is empty.

Jump to

Keyboard shortcuts

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