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

template

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package template provides directory name template processing functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor handles template processing for worktree path generation.

func New

func New(templateStr string, sanitizeChars map[string]string) (*Processor, error)

New creates a new template processor.

func (*Processor) GeneratePath

func (p *Processor) GeneratePath(baseDir string, repoInfo *url.RepositoryInfo, branch string) (string, error)

GeneratePath generates a worktree path using the configured template.

type TemplateData

type TemplateData struct {
	Host       string // e.g., "github.com"
	Owner      string // e.g., "user1"
	Repository string // e.g., "myapp"
	Branch     string // e.g., "feature/new-ui"
	Hash       string // Short hash of the repository URL + branch
}

TemplateData contains the data available for template processing.

Jump to

Keyboard shortcuts

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