MCPcopy Create free account
hub / github.com/catppuccin/cli / ListContains

Function ListContains

internal/utils/utils.go:68–75  ·  view source on GitHub ↗

DieIfError kills the program if err is not nil. func DieIfError(err error, message string) { if err != nil { // log.Fatalf("%s.\nFailed with error: %v", message, err) log.WithError(err).Fatalf("%s", message) } } ListContains checks if a list of strings contains a string

(list []string, contains string)

Source from the content-addressed store, hash-verified

66
67// ListContains checks if a list of strings contains a string
68func ListContains(list []string, contains string) bool {
69 for i := 0; i < len(list); i++ {
70 if list[i] == contains {
71 return true
72 }
73 }
74 return false
75}
76
77// CheckBetter checks if better is greater than check. If it is, it returns better, otherwise it returns check. It also returns a BoolAnd of checkbetter and if better > check.
78func CheckBetter(check int, better int, checkbetter bool) (int, bool) {

Callers 1

UpdateJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected