add errs and subdomains func

This commit is contained in:
DataHearth 2021-03-14 16:36:11 +01:00
parent d3bf027eef
commit cde6075f00
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
2 changed files with 12 additions and 0 deletions

10
pkg/utils/subdomains.go Normal file
View File

@ -0,0 +1,10 @@
package utils
func AggregateSubdomains(subdomains []string, domain string) []string {
agdSub := make([]string, len(subdomains))
for _, sd := range subdomains {
agdSub = append(agdSub, sd+"."+domain)
}
return agdSub
}

View File

@ -7,4 +7,6 @@ var (
ErrReadConfigFile = errors.New("failed to read config file")
// ErrNilLogger is thrown when the parameter logger is nil
ErrNilLogger = errors.New("logger can't be nil")
// ErrWrongStatusCode is thrown when the response status code isn't a 200
ErrWrongStatusCode = errors.New("response sent an non 200 status code")
)