/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
pkg/clean/bool.go
20 строк
574 B
Michael Mayer
Clean: Add Yes/No/Bool funcs consistent with strconv.ParseBool() #5191
11 окт 2025, 15:35
11 окт 2025, 15:35
4924114
Код
Авторство
О чём код?
package clean import "github.com/photoprism/photoprism/pkg/txt" // Bool interprets s as a boolean using txt.Bool, which supports strconv.ParseBool // tokens as well as localized yes/no mappings. func Bool(s string) bool { return txt.Bool(s) } // Yes reports whether s matches a supported affirmative token. It mirrors txt.Yes // so callers can stay within the clean package when sanitizing inputs. func Yes(s string) bool { return txt.Yes(s) } // No reports whether s matches a supported negative token. It mirrors txt.No. func No(s string) bool { return txt.No(s) }