Skip to content

Commit

Permalink
satisfy the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jul 12, 2024
1 parent 4370a17 commit dd85134
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions interp/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
)

// set trace to true for debugging the cfg and other processes
// set trace to true for debugging the cfg and other processes.
var trace = false

func traceIndent(n *node) string {
Expand All @@ -24,6 +24,8 @@ func tracePrintln(n *node, v ...any) {

// tracePrintTree is particularly useful in post-order for seeing the full
// structure of a given code segment of interest.
//
//lint:ignore
func tracePrintTree(n *node, v ...any) {

Check failure on line 29 in interp/trace.go

View workflow job for this annotation

GitHub Actions / Linting

func `tracePrintTree` is unused (unused)
if !trace {
return
Expand All @@ -35,13 +37,15 @@ func tracePrintTree(n *node, v ...any) {
}, nil)
}

// nodeAddr returns the pointer address of node, short version
// nodeAddr returns the pointer address of node, short version.
func ptrAddr(v any) string {
p := fmt.Sprintf("%p", v)
return p[:2] + p[9:] // unique bits
}

// valString returns string rep of given value, showing underlying pointers etc
// valString returns string rep of given value, showing underlying pointers etc.
//
//lint:ignore
func valString(v reflect.Value) string {

Check failure on line 49 in interp/trace.go

View workflow job for this annotation

GitHub Actions / Linting

func `valString` is unused (unused)
s := v.String()
if v.Kind() == reflect.Func || v.Kind() == reflect.Map || v.Kind() == reflect.Pointer || v.Kind() == reflect.Slice || v.Kind() == reflect.UnsafePointer {
Expand Down

0 comments on commit dd85134

Please sign in to comment.