Cross-Platform Path Separator Inconsistencies via `path` Package

Open Beginner friendly
#476 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start in pkg/config/localconfig.go around lines 112-142 and trace how configuration directories are constructed and created. Verify the change with a Windows path case such as C:\Users\Name, and consider commands such as microcks login; done means configuration paths use native separators without mixed-format failures.

Written by the indexing model from the issue text.

Description

stale
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"]
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.

Dominant language
Go
Stars
52
Forks
67
Avg merge
1d 1h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microcks/microcks-cli

All issues in microcks/microcks-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.