Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions api/v1alpha1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ func ptrString(s string) *string {
func ptrBool(b bool) *bool {
return &b
}

func ptrInt(i int) *int {
return &i
}
15 changes: 0 additions & 15 deletions cmd/build_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,3 @@ func TestBuildIDCmd(t *testing.T) {
}
})
}

// containsBuildID checks if a string contains a substring
func containsBuildID(s, substr string) bool {
return len(s) >= len(substr) && (s == substr || len(substr) == 0 ||
(len(s) > len(substr) && (s[:len(substr)] == substr ||
s[len(s)-len(substr):] == substr ||
func() bool {
for i := 0; i <= len(s)-len(substr); i++ {
if s[i:i+len(substr)] == substr {
return true
}
}
return false
}())))
}
4 changes: 0 additions & 4 deletions pkg/blueprint/feature_evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,3 @@ func writeTestFile(path, content string) error {
_, err = file.WriteString(content)
return err
}

func mkdirAll(path string) error {
return os.MkdirAll(path, 0755)
}
2 changes: 1 addition & 1 deletion pkg/config/config_handler_public_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type SetupOptions struct {
ConfigStr string
}

func setupMocks(t *testing.T, opts ...*SetupOptions) *Mocks {
func setupMocks(t *testing.T, _ ...*SetupOptions) *Mocks {
t.Helper()

tmpDir := t.TempDir()
Expand Down
6 changes: 2 additions & 4 deletions pkg/generators/git_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
// =============================================================================

const (
gitGenTestMockGitignorePath = "mock/project/root/.gitignore"
gitGenTestExistingContent = "existing content\n"
gitGenTestExpectedContent = `existing content
gitGenTestExistingContent = "existing content\n"
gitGenTestExpectedContent = `existing content

# managed by windsor cli
.windsor/
Expand All @@ -29,7 +28,6 @@ contexts/**/.talos/
contexts/**/.omni/
contexts/**/.aws/
contexts/**/.azure/`
gitGenTestExpectedPerm = fs.FileMode(0644)
)

// =============================================================================
Expand Down
24 changes: 0 additions & 24 deletions pkg/pipelines/shims.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ package pipelines

import "os"

// osStat retrieves the file info for a given path
var osStat = os.Stat

// osGetenv retrieves an environment variable
var osGetenv = os.Getenv

// osSetenv sets an environment variable
var osSetenv = os.Setenv

// osReadDir reads the directory and returns directory entries
var osReadDir = os.ReadDir

// osReadFile reads the file and returns its contents
var osReadFile = os.ReadFile

// osRemoveAll removes a directory and all its contents
var osRemoveAll = os.RemoveAll

// osMkdirAll creates a directory and all its parents
var osMkdirAll = os.MkdirAll

// osWriteFile writes data to a file
var osWriteFile = os.WriteFile

// Shims provides a testable interface for system operations used by pipelines.
// This struct-based approach allows for better isolation during testing by enabling
// dependency injection of mock implementations for file system and environment operations.
Expand Down
4 changes: 0 additions & 4 deletions pkg/workstation/services/shims.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,3 @@ func NewShims() *Shims {
func ptrString(s string) *string {
return &s
}

func ptrBool(b bool) *bool {
return &b
}
7 changes: 0 additions & 7 deletions pkg/workstation/services/talos_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ import (
"github.com/windsorcli/cli/pkg/constants"
)

// Package-level variables for mocking os functions
var (
stat = os.Stat
mkdir = os.Mkdir
mkdirAll = os.MkdirAll
)

// =============================================================================
// Test Setup
// =============================================================================
Expand Down
Loading