Exemple #1
0
func getUserIconsFromDir(dir, condition string) []string {
	imgs, err := graphic.GetImagesInDir(dir)
	if err != nil {
		return nil
	}

	var icons []string
	for _, img := range imgs {
		if !strings.Contains(img, condition) {
			continue
		}

		icons = append(icons, img)
	}

	return icons
}
Exemple #2
0
func getUserStandardIcons() []string {
	imgs, err := graphic.GetImagesInDir(userIconsDir)
	if err != nil {
		return nil
	}

	var icons []string
	for _, img := range imgs {
		if strings.Contains(img, "guest") {
			continue
		}

		icons = append(icons, img)
	}

	return icons
}