File: embed.go

package info (click to toggle)
tiup 1.16.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,384 kB
  • sloc: sh: 1,988; makefile: 138; sql: 16
file content (21 lines) | stat: -rw-r--r-- 401 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package embed

import (
	goembed "embed"
)

//go:embed templates
var embededFiles goembed.FS

// ReadTemplate read the template file embed.
func ReadTemplate(path string) ([]byte, error) {
	return embededFiles.ReadFile(path)
}

//go:embed examples
var embedExamples goembed.FS

// ReadExample read an example file
func ReadExample(path string) ([]byte, error) {
	return embedExamples.ReadFile(path)
}