Skip to content

Commit

Permalink
Rename Manifest.Id to Manifest.ID (#1596)
Browse files Browse the repository at this point in the history
Follow the Go code review recommendation
(https://go.dev/wiki/CodeReviewComments#initialisms), the Google Go
style guide
(https://google.github.io/styleguide/go/decisions#initialisms), and our
existing naming conventions regarding `ID` and rename `Manifest.Id` to
`ID`.
  • Loading branch information
MrAlias authored Jan 14, 2025
1 parent eaa821b commit 2a56ba8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/instrumentation/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (m *Manager) validateProbeDependents(id probe.ID, symbols []probe.FunctionS
}

func (m *Manager) registerProbe(p probe.Probe) error {
id := p.Manifest().Id
id := p.Manifest().ID
if _, exists := m.probes[id]; exists {
return fmt.Errorf("library %s registered twice, aborting", id)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/instrumentation/manager_load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestLoadProbes(t *testing.T) {
offsets[f.ModPath] = ver
}
}
t.Run(p.Manifest().Id.String(), func(t *testing.T) {
t.Run(p.Manifest().ID.String(), func(t *testing.T) {
testProbe, ok := p.(testutils.TestProbe)
assert.True(t, ok)
testutils.ProbesLoad(t, testProbe, offsets)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/instrumentation/probe/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type FunctionSymbol struct {
// Manifest contains information about a package being instrumented.
type Manifest struct {
// ID is a unique identifier for the probe.
Id ID
ID ID

// StructFields are the struct fields in an instrumented package that are
// used for instrumentation.
Expand Down Expand Up @@ -66,7 +66,7 @@ func NewManifest(id ID, structfields []structfield.ID, symbols []FunctionSymbol)
})

return Manifest{
Id: id,
ID: id,
StructFields: structfields,
Symbols: symbols,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/instrumentation/probe/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestNewManifest(t *testing.T) {
[]FunctionSymbol{fs(d), fs(a), fs(c), fs(b)},
)
want := Manifest{
Id: ID{spanKind, pkg},
ID: ID{spanKind, pkg},
StructFields: []structfield.ID{sAAAA, sAAAB, sAAAC, sAABA, sAABB, sAABC, sABAA, sBAAA},
Symbols: []FunctionSymbol{fs(a), fs(b), fs(c), fs(d)},
}
Expand Down

0 comments on commit 2a56ba8

Please sign in to comment.