MCPcopy Create free account
hub / github.com/cli/cli / cutLast

Function cutLast

pkg/cmd/skills/install/install.go:616–621  ·  view source on GitHub ↗

cutLast splits s around the last occurrence of sep, returning the text before and after sep, and whether sep was found.

(s, sep string)

Source from the content-addressed store, hash-verified

614// cutLast splits s around the last occurrence of sep,
615// returning the text before and after sep, and whether sep was found.
616func cutLast(s, sep string) (before, after string, found bool) {
617 if i := strings.LastIndex(s, sep); i >= 0 {
618 return s[:i], s[i+len(sep):], true
619 }
620 return s, "", false
621}
622
623func resolveVersion(opts *InstallOptions, client *api.Client, hostname string) (*discovery.ResolvedRef, error) {
624 opts.IO.StartProgressIndicatorWithLabel("Resolving version")

Callers 1

parseSkillFromOptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected