amo/scripts/len-uniq-tuple-leads.xgo

18 lines
274 B
Text
Raw Permalink Normal View History

os := import("os")
fmt := import("fmt")
json := import("json")
args := os.args()[2:]
file_path := args[0]
arr := json.decode(os.read_file(file_path))
ret := {}
for _, v in arr {
if !v.lead || !v.lead.id{
continue
}
ret[string(v.lead.id)] = 1
}
fmt.println(len(ret))