Skip to content

Commit

Permalink
Enable confusing-naming rule
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Dec 14, 2023
1 parent 9650fcb commit bf78afc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ linters-settings:
disabled: false
- name: early-return
disabled: false
- name: confusing-naming
disabled: false

issues:
exclude-rules:
Expand Down
4 changes: 2 additions & 2 deletions pkg/osquery/table/platform_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/osquery/osquery-go/plugin/table"
)

// platformTables returns an empty set. It's here as a catchall for
// platformSpecificTables returns an empty set. It's here as a catchall for
// unimplemented platforms.
func platformTables(client *osquery.ExtensionManagerClient, logger log.Logger, currentOsquerydBinaryPath string) []*table.Plugin {
func platformSpecificTables(client *osquery.ExtensionManagerClient, logger log.Logger, currentOsquerydBinaryPath string) []*table.Plugin {
return []*table.Plugin{}
}
2 changes: 1 addition & 1 deletion pkg/osquery/table/platform_tables_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
screenlockQuery = "select enabled, grace_period from screenlock"
)

func platformTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
func platformSpecificTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
munki := munki.New()

// This table uses undocumented APIs, There is some discussion at the
Expand Down
2 changes: 1 addition & 1 deletion pkg/osquery/table/platform_tables_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
osquery "github.com/osquery/osquery-go"
)

func platformTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
func platformSpecificTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
return []osquery.OsqueryPlugin{
cryptsetup.TablePlugin(logger),
gsettings.Settings(logger),
Expand Down
2 changes: 1 addition & 1 deletion pkg/osquery/table/platform_tables_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
osquery "github.com/osquery/osquery-go"
)

func platformTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
func platformSpecificTables(logger log.Logger, currentOsquerydBinaryPath string) []osquery.OsqueryPlugin {
return []osquery.OsqueryPlugin{
ProgramIcons(),
dsim_default_associations.TablePlugin(logger),
Expand Down
2 changes: 1 addition & 1 deletion pkg/osquery/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func PlatformTables(logger log.Logger, currentOsquerydBinaryPath string) []osque
tables = append(tables, dataflattentable.AllTablePlugins(logger)...)

// add in the platform specific ones (as denoted by build tags)
tables = append(tables, platformTables(logger, currentOsquerydBinaryPath)...)
tables = append(tables, platformSpecificTables(logger, currentOsquerydBinaryPath)...)

return tables
}
10 changes: 5 additions & 5 deletions pkg/traces/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
// ending the span. `keyVals` should be a list of pairs, where the first in the pair is a
// string representing the attribute key and the second in the pair is the attribute value.
func StartHttpRequestSpan(r *http.Request, keyVals ...interface{}) (*http.Request, trace.Span) {
ctx, span := startSpan(r.Context(), keyVals...)
ctx, span := startSpanWithExtractedAttributes(r.Context(), keyVals...)
return r.WithContext(ctx), span
}

Expand All @@ -36,12 +36,12 @@ func StartHttpRequestSpan(r *http.Request, keyVals ...interface{}) (*http.Reques
// ending the span. `keyVals` should be a list of pairs, where the first in the pair is a
// string representing the attribute key and the second in the pair is the attribute value.
func StartSpan(ctx context.Context, keyVals ...interface{}) (context.Context, trace.Span) {
return startSpan(ctx, keyVals...)
return startSpanWithExtractedAttributes(ctx, keyVals...)
}

// startSpan is the internal implementation of StartSpan and StartHttpRequestSpan with runtime.Caller(2)
// so that the caller of the wrapper function is used.
func startSpan(ctx context.Context, keyVals ...interface{}) (context.Context, trace.Span) {
// startSpanWithExtractedAttributes is the internal implementation of StartSpan and StartHttpRequestSpan
// with runtime.Caller(2) so that the caller of the wrapper function is used.
func startSpanWithExtractedAttributes(ctx context.Context, keyVals ...interface{}) (context.Context, trace.Span) {
spanName := defaultSpanName

opts := make([]trace.SpanStartOption, 0)
Expand Down

0 comments on commit bf78afc

Please sign in to comment.