code.gitea.io/gitea@v1.19.3/modules/svg/discover_bindata.go (about) 1 // Copyright 2020 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 //go:build bindata 5 6 package svg 7 8 import ( 9 "path/filepath" 10 11 "code.gitea.io/gitea/modules/public" 12 ) 13 14 // Discover returns a map of discovered SVG icons in bindata 15 func Discover() map[string]string { 16 svgs := make(map[string]string) 17 18 for _, file := range public.AssetNames() { 19 matched, _ := filepath.Match("img/svg/*.svg", file) 20 if matched { 21 content, err := public.Asset(file) 22 if err == nil { 23 filename := filepath.Base(file) 24 svgs[filename[:len(filename)-4]] = string(content) 25 } 26 } 27 } 28 29 return svgs 30 }