GetUIAsset reads a UI asset from the embedded filesystem. The name should be just the filename (e.g., "get-me.html").
(name string)
| 14 | // GetUIAsset reads a UI asset from the embedded filesystem. |
| 15 | // The name should be just the filename (e.g., "get-me.html"). |
| 16 | func GetUIAsset(name string) (string, error) { |
| 17 | data, err := UIAssets.ReadFile("ui_dist/" + name) |
| 18 | if err != nil { |
| 19 | return "", err |
| 20 | } |
| 21 | return string(data), nil |
| 22 | } |
| 23 | |
| 24 | // MustGetUIAsset reads a UI asset and panics if it fails. |
| 25 | // Use this when the asset is required for server operation. |
no outgoing calls
no test coverage detected