mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-12 22:48:52 +00:00
fix: remove unused import and variable flagged by go vet
Remove unused repository import from discovery_handler_test.go and unused tests variable from discovery_test.go (replaced by testCases). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
|||||||
|
|
||||||
"github.com/shankar0123/certctl/internal/api/middleware"
|
"github.com/shankar0123/certctl/internal/api/middleware"
|
||||||
"github.com/shankar0123/certctl/internal/domain"
|
"github.com/shankar0123/certctl/internal/domain"
|
||||||
"github.com/shankar0123/certctl/internal/repository"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockDiscoveryService is a mock implementation of DiscoveryService interface.
|
// MockDiscoveryService is a mock implementation of DiscoveryService interface.
|
||||||
|
|||||||
@@ -62,17 +62,6 @@ func TestDiscoveredCertificate_IsExpired(t *testing.T) {
|
|||||||
func TestDiscoveredCertificate_DaysUntilExpiry(t *testing.T) {
|
func TestDiscoveredCertificate_DaysUntilExpiry(t *testing.T) {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
tests := []struct {
|
|
||||||
name string
|
|
||||||
notAfter *time.Time
|
|
||||||
wantDays int
|
|
||||||
}{
|
|
||||||
{"nil NotAfter", nil, -1},
|
|
||||||
{"expires in 30 days", &time.Time{}, 0}, // placeholder, will be calculated below
|
|
||||||
{"expires in 1 day", &time.Time{}, 1},
|
|
||||||
{"expires in 0 days (expired)", &time.Time{}, 0},
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test with actual future times
|
// Test with actual future times
|
||||||
thirtyDaysFromNow := now.AddDate(0, 0, 30)
|
thirtyDaysFromNow := now.AddDate(0, 0, 30)
|
||||||
oneDayFromNow := now.AddDate(0, 0, 1)
|
oneDayFromNow := now.AddDate(0, 0, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user