Skip to content

funcr doesn't handle recursive pointers well #123

@thockin

Description

@thockin
type T struct {    
    P *T    
}    

func example(log logr.Logger) {    
    t := T{}    
    t.P = &t    
    log.Info("recurse", "t", t)     
}

yields a (predictable) stack overflow.

We probably should add a max-depth option or track a stack of pointers across pretty calls and not print pointers already in the stack. Or both.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions