matryer / matryer/moq

SAST. Possible mismatched call arguments in internal/registry/registry.go

Open
#241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
135
Avg merge
11d 6h
Merged PRs (30d)
1

Description

The svace static analyzer has identified a potential incorrect call to the findPkgPath function in internal/registry/registry.go on L187 the pkgInDir function is being called incorrectly in the wrong order. The subdirectoryPath
is passed as the first argument. - the full path to the package, and as the second argument pkgInputVal is the package, as far as I have carefully followed the path of the call. According to pkgInDir function definition the packet must be passed as the first argument, and the path as the second. Tell me, please, is my remark correct? Can I fix it?

Contributor guide

No contributing guide indexed for this repository

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

Open internal/registry/registry.go and inspect the call near line 187 together with the pkgInDir definition near line 193. Trace the arguments through findPkgPath and verify whether the package and path match the function signature; the issue is done when the call order is correct and the relevant behavior remains valid.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.