helpers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineOwnerAndRepo added in v0.3.0

func DetermineOwnerAndRepo(args ...string) (string, string, error)

Determine the owner and repo name from arguments passed to the command ... or from the current repository.

func FillInPlaceholders

func FillInPlaceholders(contents string, substitutions map[string]string) string

FillInPlaceholders replaces all placeholders in the provided contents with the provided substitutions.

func ListExamples added in v0.2.0

func ListExamples(examples []string) string

ListExamples takes a slice of examples (strings) and returns a string containing the examples, each on a new line, indented by two spaces. This is used to display examples in the help text for commands.

func OpenInBrowser added in v0.3.0

func OpenInBrowser(url string) error

OpenInBrowser opens the specified URL in the default browser.

func Prettify added in v0.3.0

func Prettify(input any) (string, error)

Prettify takes an input of any type and returns a prettified JSON string. If the input cannot be converted to JSON, or the JSON cannot be prettified, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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