[优化] 优化代码

This commit is contained in:
ryan
2026-05-31 13:23:49 +08:00
parent 9975ac90c4
commit bcd669722e
4 changed files with 0 additions and 58 deletions
-23
View File
@@ -1,23 +0,0 @@
package utils
import (
"log/slog"
"os/exec"
"runtime"
)
func OpenBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
}
if err != nil {
slog.Error("open browser failed", "error", err)
}
}
-7
View File
@@ -1,7 +0,0 @@
package utils
import "html/template"
func UnescapeHTML(x string) interface{} {
return template.HTML(x)
}
-15
View File
@@ -1,15 +0,0 @@
package utils
func IntMax(a int, b int) int {
if a >= b {
return a
}
return b
}
func Max(a int, b int) int {
if a >= b {
return a
}
return b
}
-13
View File
@@ -1,13 +0,0 @@
package utils
import (
"strings"
"github.com/google/uuid"
)
func GetUUID() string {
code := uuid.New().String()
code = strings.Replace(code, "-", "", -1)
return code
}