package config import ( _ "embed" "encoding/json" "log" "slices" ) //go:embed domain.json var domainsFiles []byte var Domains map[string][]string func init() { err := json.Unmarshal(domainsFiles, &Domains) if err != nil { log.Fatal(err) } } func AddDomain(domain, tld string) { if _, ok := Domains[domain]; ok { if !slices.Contains(Domains[domain], tld) { Domains[domain] = append(Domains[domain], tld) } } else { Domains[domain] = []string{tld} } }