microcks / microcks/microcks-cli

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.

stale
Dominant language
Go
Stars
52
Forks
68
Avg merge
6h 54m
Merged PRs (30d)
10

Description

### 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](file:///c:/Users/Hp/microcks-cli/pkg/config/localconfig.go#L112-L142)

### Diagram
```mermaid
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.

---

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.