Skip to content

Commit

Permalink
Enable Lint Rule: modifies-value-receiver (#5517)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled modifies-value-receiver in revive linter. 
- Removed instances where pass-by-values where re-assigned and returned.

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <[email protected]>
  • Loading branch information
FlamingSaint authored Jun 3, 2024
1 parent f56409c commit c74aec1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,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
7 changes: 4 additions & 3 deletions cmd/agent/app/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ 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 {
if c.HostPort == "" {
c.HostPort = defaultHTTPServerHostPort
hostPort := c.HostPort
if hostPort == "" {
hostPort = defaultHTTPServerHostPort
}
return httpserver.NewHTTPServer(c.HostPort, manager, mFactory, logger)
return httpserver.NewHTTPServer(hostPort, manager, mFactory, logger)
}

// GetThriftProcessor gets a TBufferedServer backed Processor using the collector configuration
Expand Down
7 changes: 4 additions & 3 deletions model/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const (

// ApplyDefaults applies defaults to the DependencyLink.
func (d DependencyLink) ApplyDefaults() DependencyLink {
if d.Source == "" {
d.Source = JaegerDependencyLinkSource
dd := d
if dd.Source == "" {
dd.Source = JaegerDependencyLinkSource
}
return d
return dd
}

0 comments on commit c74aec1

Please sign in to comment.