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

projectinit

package
v0.49.0 Latest Latest
Warning

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

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

Documentation

Overview

Package projectinit creates the on-disk Volcano project scaffold.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStarter added in v0.48.0

func CheckStarter(starterName string) error

CheckStarter returns the error RunStarter would return for starterName before it touches any file. Empty names the base scaffold.

func CheckStarterIn added in v0.48.0

func CheckStarterIn(dir, starterName string) error

CheckStarterIn returns the error RunStarterIn would return, without changing any file.

func ConflictMessages

func ConflictMessages(err error) ([]string, bool)

ConflictMessages returns formatted conflict details from an init error.

func ConflictsCanBeForced

func ConflictsCanBeForced(err error) bool

ConflictsCanBeForced reports whether --force can resolve every conflict in err.

Types

type Result

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

Result describes the filesystem changes made by one init run.

func Run

func Run(force bool) (*Result, error)

Run creates the Volcano project scaffold in the current directory.

func RunStarter

func RunStarter(starterName string, force bool) (*Result, error)

RunStarter creates the base scaffold plus an optional starter overlay.

func RunStarterIn added in v0.48.0

func RunStarterIn(dir, starterName string) (*Result, error)

RunStarterIn adds the base scaffold and a starter to dir, a directory that may already hold some of it, as one `volcano connect` set up does. Unlike RunStarter, it keeps existing base scaffold files, which belong to the user once created, and appends the starter's missing lines to a .gitignore that differs. Other starter files that differ are conflicts, unless every starter file exists: then the starter is in place, and the files that differ are the user's changes, kept and listed in Result.Kept. It never overwrites.

func (*Result) Created

func (r *Result) Created() []string

Created returns paths created by init.

func (*Result) Kept added in v0.48.0

func (r *Result) Kept() []string

Kept returns the starter files RunStarterIn left changed, because the starter was already in place.

func (*Result) Merged added in v0.48.0

func (r *Result) Merged() []string

Merged returns the .gitignore files RunStarterIn added starter lines to.

func (*Result) Overwritten

func (r *Result) Overwritten() []string

Overwritten returns paths replaced because force mode was enabled.

func (*Result) Unchanged

func (r *Result) Unchanged() []string

Unchanged returns existing paths that already matched the starter.

Jump to

Keyboard shortcuts

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