attributedstring

package
v0.64.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slice

type Slice struct {
	// Note that the fields below _must_ be exported.  Otherwise the TOML
	// encoder would fail during type reflection.
	Values     []string
	Attributes struct {
		Append *bool // Nil if not set by the user
	}
}

Slice allows for extending a TOML string array with custom attributes that control how the array is marshaled into a Go string.

Specifically, an Slice can be configured to avoid it being overridden by a subsequent unmarshal sequence. When the `append` attribute is specified, the array will be appended instead (e.g., `array=["9", {append=true}]`).

func NewSlice

func NewSlice(values []string) Slice

NewSlice creates a new slice with the specified values.

func (*Slice) Get

func (a *Slice) Get() []string

Get returns the Slice values or an empty string slice.

func (*Slice) MarshalTOML

func (a *Slice) MarshalTOML() ([]byte, error)

MarshalTOML is the custom marshal method for Slice.

func (*Slice) Set

func (a *Slice) Set(values []string)

Set overrides the values of the Slice.

func (*Slice) UnmarshalTOML

func (a *Slice) UnmarshalTOML(data any) error

UnmarshalTOML is the custom unmarshal method for Slice.

Jump to

Keyboard shortcuts

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