seperate routes, provide robust handler types, use mux
This commit is contained in:
13
assets/assets.go
Normal file
13
assets/assets.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package assets
|
||||
|
||||
import "strings"
|
||||
|
||||
// PrefixDo runs a given callback for every path in our assets with
|
||||
// the given prefix
|
||||
func PrefixDo(pre string, cb func(path string, asset *EmbeddedAsset)) {
|
||||
for path, asset := range Bytes {
|
||||
if strings.HasPrefix(path, pre) {
|
||||
cb(path, asset)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user