/
githubmirror
/
gogs
Обзор
Документация
Войти
/
githubmirror
/
gogs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.13.2
conf/embed.go
27 строк
647 B
Michael Li
assets: convert usage of go-bindata to Go embed (#6851)
17 мар 2022, 09:05
Не верифицирован
17 мар 2022, 09:05
32c454b
Код
Авторство
О чём код?
// Copyright 2022 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package conf import ( "embed" ) //go:embed app.ini **/* var Files embed.FS // FileNames returns a list of filenames exists in the given direction within // Files. The list includes names of subdirectories. func FileNames(dir string) ([]string, error) { entries, err := Files.ReadDir(dir) if err != nil { return nil, err } fileNames := make([]string, 0, len(entries)) for _, entry := range entries { fileNames = append(fileNames, entry.Name()) } return fileNames, nil }