Skip to content

Commit

Permalink
Create embed.go
Browse files Browse the repository at this point in the history
  • Loading branch information
parthmalhotra authored Oct 30, 2024
1 parent c5eb5ef commit 9fa3c09
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package awesomesearchqueries

import (
"embed"
)

//go:embed QUERIES.json wordpress/wp-plugins.txt wordpress/wp-themes.txt
var embeddedFiles embed.FS

// GetQueries returns the content of QUERIES.json file
func GetQueries() ([]byte, error) {
return embeddedFiles.ReadFile("QUERIES.json")
}

// GetWordPressPlugins returns the content of wordpress/wp-plugins.txt file
func GetWordPressPlugins() ([]byte, error) {
return embeddedFiles.ReadFile("wordpress/wp-plugins.txt")
}

// GetWordPressThemes returns the content of wordpress/wp-themes.txt file
func GetWordPressThemes() ([]byte, error) {
return embeddedFiles.ReadFile("wordpress/wp-themes.txt")
}

0 comments on commit 9fa3c09

Please sign in to comment.