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 Rules: confusing-results & receiver-naming #5524

Merged
merged 3 commits into from
Jun 4, 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
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,9 @@ linters-settings:
# investigate, could be real bugs. But didn't recent Go version changed loop variables semantics?
- name: range-val-address
disabled: true
# enable after cleanup
- name: confusing-results
disabled: true
# enable after cleanup: "tag on not-exported field"
- name: struct-tag
disabled: true
# enable after cleanup
- name: receiver-naming
disabled: true
# this is idiocy, promotes less readable code. Don't enable.
- name: var-declaration
disabled: true
Expand Down
6 changes: 3 additions & 3 deletions model/converter/thrift/zipkin/to_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@
}

// Get a correct start time to use for the span if it's not set directly
func (td toDomain) getStartTimeAndDuration(zSpan *zipkincore.Span) (int64, int64) {
timestamp := zSpan.GetTimestamp()
duration := zSpan.GetDuration()
func (td toDomain) getStartTimeAndDuration(zSpan *zipkincore.Span) (timestamp, duration int64) {
timestamp = zSpan.GetTimestamp()
duration = zSpan.GetDuration()

Check warning on line 203 in model/converter/thrift/zipkin/to_domain.go

View check run for this annotation

Codecov / codecov/patch

model/converter/thrift/zipkin/to_domain.go#L201-L203

Added lines #L201 - L203 were not covered by tests
if timestamp == 0 {
cs := td.findAnnotation(zSpan, zipkincore.CLIENT_SEND)
sr := td.findAnnotation(zSpan, zipkincore.SERVER_RECV)
Expand Down
22 changes: 11 additions & 11 deletions pkg/config/tlscfg/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ func (p Options) loadCertPool() (*x509.CertPool, error) {
return certPool, nil
}

func (o *Options) ToOtelClientConfig() configtls.ClientConfig {
func (p *Options) ToOtelClientConfig() configtls.ClientConfig {
return configtls.ClientConfig{
Insecure: !o.Enabled,
InsecureSkipVerify: o.SkipHostVerify,
ServerName: o.ServerName,
Insecure: !p.Enabled,
InsecureSkipVerify: p.SkipHostVerify,
ServerName: p.ServerName,
Config: configtls.Config{
CAFile: o.CAPath,
CertFile: o.CertPath,
KeyFile: o.KeyPath,
CipherSuites: o.CipherSuites,
MinVersion: o.MinVersion,
MaxVersion: o.MaxVersion,
ReloadInterval: o.ReloadInterval,
CAFile: p.CAPath,
CertFile: p.CertPath,
KeyFile: p.KeyPath,
CipherSuites: p.CipherSuites,
MinVersion: p.MinVersion,
MaxVersion: p.MaxVersion,
ReloadInterval: p.ReloadInterval,
},
}
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/storage/es/mappings/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func (mb *MappingBuilder) GetMapping(mapping string) (string, error) {
}

// GetSpanServiceMappings returns span and service mappings
func (mb *MappingBuilder) GetSpanServiceMappings() (string, string, error) {
spanMapping, err := mb.GetMapping("jaeger-span")
func (mb *MappingBuilder) GetSpanServiceMappings() (spanMapping string, serviceMapping string, err error) {
spanMapping, err = mb.GetMapping("jaeger-span")
if err != nil {
return "", "", err
}
serviceMapping, err := mb.GetMapping("jaeger-service")
serviceMapping, err = mb.GetMapping("jaeger-service")
if err != nil {
return "", "", err
}
Expand Down
Loading