feat: create standalone native fnOS repository

This commit is contained in:
2026-10-02 15:19:09 +08:00
parent 69f3c30fab
commit 6725fc131d
492 changed files with 94023 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
package frp
import (
"net"
"testing"
)
func TestFormatLocation(t *testing.T) {
value := formatLocation(ipLocationResponse{City: "Hong Kong", Region: "Hong Kong", Country: "China"})
if value != "Hong Kong · China" {
t.Fatalf("位置格式错误:%s", value)
}
}
func TestIsPublicIP(t *testing.T) {
if !isPublicIP(net.ParseIP("38.95.74.87")) {
t.Fatal("公网 IP 应被识别")
}
if isPublicIP(net.ParseIP("192.168.1.1")) {
t.Fatal("私网 IP 不应被定位")
}
}