Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Lint Rule: modifies-value-receiver #5517

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ linters-settings:
# TBD - often triggered in tests
- name: unhandled-error
disabled: true
# this one looks like it's catching real errors, need to enable it
- name: modifies-value-receiver
disabled: true
# often looks like a red herring, needs investigation
- name: flag-parameter
disabled: true
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent/app/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (b *Builder) getProcessors(rep reporter.Reporter, mFactory metrics.Factory,
}

// GetHTTPServer creates an HTTP server that provides sampling strategies and baggage restrictions to client libraries.
func (c HTTPServerConfiguration) getHTTPServer(manager configmanager.ClientConfigManager, mFactory metrics.Factory, logger *zap.Logger) *http.Server {
func (c *HTTPServerConfiguration) getHTTPServer(manager configmanager.ClientConfigManager, mFactory metrics.Factory, logger *zap.Logger) *http.Server {
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
if c.HostPort == "" {
c.HostPort = defaultHTTPServerHostPort
}
Expand Down
3 changes: 1 addition & 2 deletions model/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ const (
)

// ApplyDefaults applies defaults to the DependencyLink.
func (d DependencyLink) ApplyDefaults() DependencyLink {
func (d *DependencyLink) ApplyDefaults() {
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
if d.Source == "" {
d.Source = JaegerDependencyLinkSource
}
return d
}
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 4 additions & 2 deletions model/dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import (
)

func TestDependencyLinkApplyDefaults(t *testing.T) {
dl := DependencyLink{}.ApplyDefaults()
dl := DependencyLink{}
dl.ApplyDefaults()
assert.Equal(t, JaegerDependencyLinkSource, dl.Source)

networkSource := "network"
dl = DependencyLink{Source: networkSource}.ApplyDefaults()
dl = DependencyLink{Source: networkSource}
dl.ApplyDefaults()
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
assert.Equal(t, networkSource, dl.Source)
}
3 changes: 2 additions & 1 deletion plugin/storage/cassandra/dependencystore/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ func (s *DependencyStore) GetDependencies(ctx context.Context, endTs time.Time,
Child: dependency.Child,
CallCount: uint64(dependency.CallCount),
Source: dependency.Source,
}.ApplyDefaults()
}
dl.ApplyDefaults()
mDependency = append(mDependency, dl)
}
}
Expand Down
Loading