Skip to content

Commit

Permalink
refactor: fix for golanglint-ci (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKepczynskiSauce authored Sep 18, 2024
1 parent 547333d commit 9dac068
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit 9dac068

Please sign in to comment.