Azure / Azure/azure-sdk-tools

apiviewgo assumes root package name matches module name

Open
#8,692 0 comments 0 reactions 0 assignees View on GitHub
APIView bug Go
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

https://github.com/Azure/azure-sdk-tools/blob/9a09542c3b53d0ed6d1f307f41905242c05cd861/src/go/cmd/pkg.go#L63-L64

This is true for most, if not all, SDK modules, however it isn't always true in general. The root package of a module may have any name. When the package name doesn't match the module name, `Module` stores the parsed `Pkg` with the wrong key, making the package's types unfindable during alias resolution:
https://github.com/Azure/azure-sdk-tools/blob/9a09542c3b53d0ed6d1f307f41905242c05cd861/src/go/cmd/module.go#L97
(`p.Name() == Pkg.relName`)

Contributor guide

Open the contributing guide

Research direction

Read src/go/cmd/pkg.go at lines 63-64 and src/go/cmd/module.go at line 97. Trace how the root package is parsed and stored, then verify alias resolution when the package name differs from the module name. Done means the package's types remain findable under that valid naming difference.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.