-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
40 lines (31 loc) · 789 Bytes
/
types.go
File metadata and controls
40 lines (31 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package pprint
import (
"io"
"reflect"
)
type Context map[uintptr]int
type DispatchMap map[reflect.Kind]pprinter
type pprinter func(pp PrettyPrinter, object any, stream io.Writer, indent, allowance int, context Context, level int)
type MappingItem struct {
Key any
Entry any
}
type StructField struct {
Name string
Entry any
}
func (ctx Context) Contains(objectId uintptr) bool {
_, exists := ctx[objectId]
return exists
}
type InaccessibleField struct {
Name string
Reason string
}
func (i InaccessibleField) String() string {
return "<InaccessibleField>" // Custom string representation when printed
}
// func reprInaccessible() string {
// // return fmt.Sprintf("%v", reflect.TypeOf(InaccessibleField{}))
// return fmt.Sprintf("%v", InaccessibleField{})
// }