mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 14:44:42 -05:00
🔥 Remove test dir, verison length limit
This commit is contained in:
parent
3330412243
commit
25e47453cb
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,5 @@ subs
|
|||||||
logs
|
logs
|
||||||
data
|
data
|
||||||
.env
|
.env
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
|
test
|
@ -18,7 +18,6 @@ var staticFiles embed.FS
|
|||||||
func SetRoute(r *gin.Engine) {
|
func SetRoute(r *gin.Engine) {
|
||||||
r.Use(middleware.ZapLogger())
|
r.Use(middleware.ZapLogger())
|
||||||
|
|
||||||
// 使用内嵌的模板文件
|
|
||||||
tpl, err := template.ParseFS(staticFiles, "static/*")
|
tpl, err := template.ParseFS(staticFiles, "static/*")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error parsing templates: %v", err)
|
log.Fatalf("Error parsing templates: %v", err)
|
||||||
@ -33,9 +32,6 @@ func SetRoute(r *gin.Engine) {
|
|||||||
r.GET(
|
r.GET(
|
||||||
"/", func(c *gin.Context) {
|
"/", func(c *gin.Context) {
|
||||||
version := constant.Version
|
version := constant.Version
|
||||||
if len(constant.Version) > 7 {
|
|
||||||
version = constant.Version[:7]
|
|
||||||
}
|
|
||||||
c.HTML(
|
c.HTML(
|
||||||
200, "index.html", gin.H{
|
200, "index.html", gin.H{
|
||||||
"Version": version,
|
"Version": version,
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
package test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestParser(t *testing.T) {
|
|
||||||
// res, err := parser.ParseTrojan("trojan://Abse64hhjewrs@test.com:8443?type=ws&path=%2Fx&host=test.com&security=tls&fp=&alpn=http%2F1.1&sni=test.com#test")
|
|
||||||
// if err != nil {
|
|
||||||
// t.Log(err.Error())
|
|
||||||
// t.Fail()
|
|
||||||
// }
|
|
||||||
// bytes, err := yaml.Marshal(res)
|
|
||||||
// if err != nil {
|
|
||||||
// t.Log(err.Error())
|
|
||||||
// t.Fail()
|
|
||||||
// }
|
|
||||||
// t.Log(string(bytes))
|
|
||||||
t.Log(strings.SplitN("123456", "/?", 2))
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user