Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for StringBoolMapToSlice (0.17 sec)

  1. operator/pkg/util/util.go

    	"strconv"
    	"strings"
    	"text/template"
    
    	"google.golang.org/protobuf/types/known/structpb"
    )
    
    type FileFilter func(fileName string) bool
    
    // StringBoolMapToSlice creates and returns a slice of all the map keys with true.
    func StringBoolMapToSlice(m map[string]bool) []string {
    	s := make([]string, 0, len(m))
    	for k, v := range m {
    		if v {
    			s = append(s, k)
    		}
    	}
    	return s
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 02 13:01:43 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. operator/pkg/util/util_test.go

    			},
    			want: []string{
    				"yo",
    				"test1",
    				"baseball hat",
    			},
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if got, want := StringBoolMapToSlice(tt.in), tt.want; !(sameStringSlice(got, want)) {
    				t.Errorf("%s: got:%s, want: %s", tt.desc, got, want)
    			}
    		})
    	}
    }
    
    // Helper function to check if values in 2 slices are the same,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  3. operator/pkg/helm/renderer.go

    }
    
    // list all the profiles.
    func ListProfiles(charts string) ([]string, error) {
    	profiles, err := readProfiles(charts)
    	if err != nil {
    		return nil, err
    	}
    	return util.StringBoolMapToSlice(profiles), nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 13 01:59:17 UTC 2022
    - 5K bytes
    - Viewed (0)
Back to top