fork/gdu

git clone https://git.julia.blue/fork/gdu

ShivamB25feat: customize JSON export attributes (#605)d062e88

subvolume
408 B14 linesraw
1package fs
2
3// JSONAttributes selects optional attributes written to an analysis export.
4// A nil set preserves the complete legacy export.
5type JSONAttributes map[string]struct{}
6
7// Includes reports whether an optional JSON attribute should be written.
8func (attributes JSONAttributes) Includes(attribute string) bool {
9	if attributes == nil {
10		return true
11	}
12	_, ok := attributes[attribute]
13	return ok
14}