/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/form/file.go
24 строки
542 B
Michael Mayer
Go: Apply go fix modernizations across backend packages
20 фев 2026, 05:54
20 фев 2026, 05:54
a2b7615
Код
Авторство
О чём код?
package form import ( "github.com/ulule/deepcopier" "github.com/photoprism/photoprism/pkg/clean" ) // File represents a file edit form. type File struct { FileOrientation int `json:"Orientation"` } // Orientation returns the Exif orientation value within a valid range or 0 if it is invalid. func (f *File) Orientation() int { return clean.Orientation(f.FileOrientation) } // NewFile copies values from an arbitrary model into a File form. func NewFile(m any) (f File, err error) { err = deepcopier.Copy(m).To(&f) return f, err }