Skip to content
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
1 change: 1 addition & 0 deletions cmd/tkn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func main() {
}

// if we have found the plugin then sysexec it by replacing current process.
// #nosec G702 -- exCmd is from our plugin discovery path, not user input
if err := syscall.Exec(exCmd, append([]string{exCmd}, os.Args[2:]...), os.Environ()); err != nil {
fmt.Fprintf(os.Stderr, "Command finished with error: %v", err)
os.Exit(127)
Expand Down
2 changes: 2 additions & 0 deletions pkg/formatted/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ type atomicCounter struct {
func (c *atomicCounter) next() int {
v := atomic.AddUint32(&c.value, 1)
next := int(v-1) % c.threshold
// nolint
// this conversion is throwing error for golangci-lint G115
atomic.CompareAndSwapUint32(&c.value, uint32(c.threshold), 0)
return next

Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func GetAllTknPluginFromPaths() []string {
continue
}
fpath := filepath.Join(path, file.Name())
// #nosec G703 -- fpath is from filepath.Join with validated path
info, err := os.Stat(fpath)
if err != nil {
continue
Expand Down
12 changes: 6 additions & 6 deletions pkg/suggestion/suggest.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ func levenshteinDistance(s, t string, ignoreCase bool) int {
if s[i-1] == t[j-1] {
d[i][j] = d[i-1][j-1]
} else {
min := d[i-1][j]
if d[i][j-1] < min {
min = d[i][j-1]
minCost := d[i-1][j]
if d[i][j-1] < minCost {
minCost = d[i][j-1]
}
if d[i-1][j-1] < min {
min = d[i-1][j-1]
if d[i-1][j-1] < minCost {
minCost = d[i-1][j-1]
}
d[i][j] = min + 1
d[i][j] = minCost + 1
}
}

Expand Down
Loading