Skip to content

Cross-Platform Path Separator Inconsistencies via path Package #476

Description

@aniket866

Describe the bug

Description

In pkg/config/localconfig.go, configuration directory pathing and creation utilities use the path package instead of path/filepath. The Go standard library path package is strictly designed for forward-slash URL paths and does not handle Windows backslashes (\).

Impact

On Windows systems, paths are constructed in a mixed format (e.g. C:\Users\Name/.config/microcks/config), which causes file system APIs and permissions logic to fail or look in wrong locations.

Code Reference

  • pkg/config/localconfig.go

Diagram

graph TD
    A["getHomeDir() on Windows -> 'C:\\Users\\Name'"] --> B["path.Join(homeDir, '.config', 'microcks')"]
    B --> C["Result: 'C:\\Users\\Name/.config/microcks'"]
    C --> D["os.MkdirAll() creates folders with mixed slashes, breaking standard Windows paths"]
Loading

Steps to Reproduce

  1. Execute any command that reads or writes config on Windows (e.g., microcks login).
  2. The config directory is created/resolved in a non-native path format with mixed slashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleState due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions