-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
package asset | ||
|
||
import _ "embed" | ||
import "embed" | ||
|
||
//go:embed trojan-install.sh | ||
var installF string | ||
//go:embed trojan-install.sh client.json | ||
var f embed.FS | ||
|
||
//go:embed client.json | ||
var clientF string | ||
|
||
// GetAssetStr 获取资源字符串 | ||
func GetAssetStr(ftype int) string { | ||
if ftype == 0 { | ||
return installF | ||
} else if ftype == 1 { | ||
return clientF | ||
} | ||
return "" | ||
// GetAsset 获取资源字符串 | ||
func GetAsset(name string) []byte { | ||
data, _ := f.ReadFile(name) | ||
return data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters