Skip to content

Commit 9fa3c09

Browse files
Create embed.go
1 parent c5eb5ef commit 9fa3c09

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

embed.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package awesomesearchqueries
2+
3+
import (
4+
"embed"
5+
)
6+
7+
//go:embed QUERIES.json wordpress/wp-plugins.txt wordpress/wp-themes.txt
8+
var embeddedFiles embed.FS
9+
10+
// GetQueries returns the content of QUERIES.json file
11+
func GetQueries() ([]byte, error) {
12+
return embeddedFiles.ReadFile("QUERIES.json")
13+
}
14+
15+
// GetWordPressPlugins returns the content of wordpress/wp-plugins.txt file
16+
func GetWordPressPlugins() ([]byte, error) {
17+
return embeddedFiles.ReadFile("wordpress/wp-plugins.txt")
18+
}
19+
20+
// GetWordPressThemes returns the content of wordpress/wp-themes.txt file
21+
func GetWordPressThemes() ([]byte, error) {
22+
return embeddedFiles.ReadFile("wordpress/wp-themes.txt")
23+
}

0 commit comments

Comments
 (0)