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

refactor: fix for golanglint-ci #20

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 2 deletions bcd_sys_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ func EnableTracing() error {
// PR_SET_PTRACER_ANY may be a negative integer constant on some
// systems, so we need to store it in a separate variable to bypass
// Go's const conversion restrictions.
var flag uint64
flag = sys.PR_SET_PTRACER_ANY
flag := uint64(sys.PR_SET_PTRACER_ANY)

return sys.Prctl(sys.PR_SET_PTRACER, uintptr(flag), 0, 0, 0)
}
8 changes: 4 additions & 4 deletions tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (t *BTTracer) ConfigurePut(endpoint, token string, options PutOptions) erro
url.Scheme = defaultCoronerScheme
}

if strings.IndexAny(url.Host, ":") == -1 {
if !strings.ContainsAny(url.Host, ":") {
url.Host += ":" + defaultCoronerPort
}

Expand Down Expand Up @@ -275,7 +275,7 @@ func putDirWalk(t *BTTracer) filepath.WalkFunc {
}

if !strings.HasSuffix(info.Name(), ".btt") {
t.Logf(LogDebug, "Ignoring file %s: suffix '.btt' " +
t.Logf(LogDebug, "Ignoring file %s: suffix '.btt' "+
"is required\n", info.Name())
return nil
}
Expand Down Expand Up @@ -392,13 +392,13 @@ func (t *BTTracer) AddOptions(options []string, v ...string) []string {
// Append to an option with given prefix
func AppendOptionWithPrefix(options []string, prefix string, v string) []string {
for i, opt := range options {
if strings.HasPrefix(opt, prefix) == true {
if strings.HasPrefix(opt, prefix) {
new_opt := opt + "," + v
options[i] = new_opt
return options
}
}
return append(options, prefix + v)
return append(options, prefix+v)
}

func (t *BTTracer) AppendOptionWithPrefix(options []string, prefix string, v string) []string {
Expand Down
Loading