diff --git a/internal/app/app_test.go b/internal/app/app_test.go index e7d31fd..58bf2cc 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -110,30 +110,6 @@ func TestNewApp(t *testing.T) { } } -// TestSetPidFile 测试 SetPidFile setter 方法。 -func TestSetPidFile(t *testing.T) { - app := NewApp("/test/config.yaml") - pidPath := "/var/run/lolly.pid" - - app.SetPidFile(pidPath) - - if app.pidFile != pidPath { - t.Errorf("pidFile = %q, want %q", app.pidFile, pidPath) - } -} - -// TestSetLogFile 测试 SetLogFile setter 方法。 -func TestSetLogFile(t *testing.T) { - app := NewApp("/test/config.yaml") - logPath := "/var/log/lolly.log" - - app.SetLogFile(logPath) - - if app.logFile != logPath { - t.Errorf("logFile = %q, want %q", app.logFile, logPath) - } -} - // TestSigName 测试信号名称辅助函数。 func TestSigName(t *testing.T) { tests := []struct { diff --git a/internal/sslutil/tlsconfig.go b/internal/sslutil/tlsconfig.go index f7a155d..2fcc4f8 100644 --- a/internal/sslutil/tlsconfig.go +++ b/internal/sslutil/tlsconfig.go @@ -15,31 +15,6 @@ const ( tlsV13Upper = "TLSV1.3" ) -// ParseTLSVersion parses a TLS version string to a tls constant. -// -// Parameters: -// - version: TLS version string (e.g., "TLSv1.0", "TLSv1.1", "TLSv1.2", "TLSv1.3") -// -// Returns: -// - uint16: TLS version constant -// - error: Invalid version string returns error -func ParseTLSVersion(version string) (uint16, error) { - switch version { - case "TLSv1.0", "TLSV1.0": - return tls.VersionTLS10, nil - case "TLSv1.1", "TLSV1.1": - return tls.VersionTLS11, nil - case tlsV12Lower, tlsV12Upper: - return tls.VersionTLS12, nil - case tlsV13Lower, tlsV13Upper: - return tls.VersionTLS13, nil - case "": - return 0, nil // Empty string means use default - default: - return 0, fmt.Errorf("invalid TLS version: %s", version) - } -} - // ParseTLSVersions parses TLS protocol version strings. // // Returns minimum and maximum TLS versions.