INNER CODE UNIT · Go

all

bank-vaults/bank-vaults · cmd/bank-vaults/common.go:56

func all(flags []string, target string) bool {
	for _, value := range flags {
		if value != target {
			return false
		}
	}

	return true
}

// correctValues checks whether or not all values of a slice are present in the choices slice
func correctValues(flags, choices []string) bool {
	choicesMap := make(map[string]string)
	for _, value := range choices {
		choicesMap[value] = ""
	}
	for _, value := range flags {
		if _, exists := choicesMap[value]; !exists {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…