Debugging the Set data struct. Fix mistyping
This commit is contained in:
@ -35,16 +35,15 @@ type dnsexitDTO struct {
|
||||
}
|
||||
|
||||
func convertInterfaceSliceToStruct(slice []interface{}) *[]dns.Record {
|
||||
var domains []dns.Record
|
||||
var domains []dns.Record
|
||||
|
||||
for _, domain := range slice {
|
||||
fmt.Println(domain)
|
||||
}
|
||||
for _, domain := range slice {
|
||||
fmt.Println(domain)
|
||||
}
|
||||
|
||||
return &domains
|
||||
return &domains
|
||||
}
|
||||
|
||||
|
||||
func (c *client) AddRecord(rec *dns.Record) (error, *dns.Response) {
|
||||
c.Locker.Lock()
|
||||
defer c.Locker.Unlock()
|
||||
@ -142,7 +141,7 @@ func (c *client) UpdateRecord(rec *dns.Record) (error, *dns.Response) {
|
||||
return nil, &dns.Response{Message: string(body)}
|
||||
}
|
||||
|
||||
func (c *client) GetRecords() (error, []*dns.Record) {
|
||||
func (c *client) GetRecords() (error, *[]dns.Record) {
|
||||
var subdomains = CreateSet()
|
||||
var wg sync.WaitGroup
|
||||
|
||||
@ -180,13 +179,14 @@ func (c *client) GetRecords() (error, []*dns.Record) {
|
||||
select {
|
||||
case records, ok := <-result_chan:
|
||||
if !ok {
|
||||
return nil, convertInterfaceSliceToStruct(subdomains.List())
|
||||
records_new := convertInterfaceSliceToStruct(subdomains.List())
|
||||
return nil, records_new
|
||||
}
|
||||
|
||||
for record := range records {
|
||||
subdomains.Add(record)
|
||||
}
|
||||
case _, _ = <-err_chan:
|
||||
|
||||
for record := range records {
|
||||
subdomains.Add(record)
|
||||
}
|
||||
case _, _ = <-err_chan:
|
||||
}
|
||||
}
|
||||
|
||||
|
4
go.mod
4
go.mod
@ -3,11 +3,11 @@ module git.uoc.run.place/OxFF/dnsexit-manager
|
||||
go 1.23.4
|
||||
|
||||
require (
|
||||
git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107205730-c4ab438a9fd5 // indirect
|
||||
git.uoc.run.place/OxFF/dns-manager v0.0.0-20250114185820-a31877a751b9 // indirect
|
||||
github.com/miekg/dns v1.1.62 // indirect
|
||||
golang.org/x/mod v0.18.0 // indirect
|
||||
golang.org/x/net v0.27.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
golang.org/x/tools v0.22.0 // indirect
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user