parse

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package parse provides shared text-to-typed-value conversion functions.

Functions here convert string inputs (dates, durations, identifiers) into Go types. They are thin wrappers that handle empty inputs and use canonical format constants from the config package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(s string) (time.Time, error)

Date parses a YYYY-MM-DD string into a time.Time at midnight UTC. An empty string returns the zero time with no error.

Parameters:

  • s: date string in YYYY-MM-DD format. Empty is a no-op.

Returns:

  • time.Time: parsed date at midnight UTC, or zero time if s is empty.
  • error: non-nil if the string is non-empty and malformed.

func WordSet

func WordSet(text string) map[string]bool

WordSet splits text into a set of unique words for O(1) lookup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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