Debugging the Set data struct. Fix mistyping

This commit is contained in:
2025-01-19 23:19:56 +03:00
parent 05e035925f
commit 19b44c14d9
2 changed files with 15 additions and 15 deletions

View File

@ -35,16 +35,15 @@ type dnsexitDTO struct {
} }
func convertInterfaceSliceToStruct(slice []interface{}) *[]dns.Record { func convertInterfaceSliceToStruct(slice []interface{}) *[]dns.Record {
var domains []dns.Record var domains []dns.Record
for _, domain := range slice { for _, domain := range slice {
fmt.Println(domain) fmt.Println(domain)
} }
return &domains return &domains
} }
func (c *client) AddRecord(rec *dns.Record) (error, *dns.Response) { func (c *client) AddRecord(rec *dns.Record) (error, *dns.Response) {
c.Locker.Lock() c.Locker.Lock()
defer c.Locker.Unlock() 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)} 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 subdomains = CreateSet()
var wg sync.WaitGroup var wg sync.WaitGroup
@ -180,13 +179,14 @@ func (c *client) GetRecords() (error, []*dns.Record) {
select { select {
case records, ok := <-result_chan: case records, ok := <-result_chan:
if !ok { if !ok {
return nil, convertInterfaceSliceToStruct(subdomains.List()) records_new := convertInterfaceSliceToStruct(subdomains.List())
return nil, records_new
} }
for record := range records { for record := range records {
subdomains.Add(record) subdomains.Add(record)
} }
case _, _ = <-err_chan: case _, _ = <-err_chan:
} }
} }

4
go.mod
View File

@ -3,11 +3,11 @@ module git.uoc.run.place/OxFF/dnsexit-manager
go 1.23.4 go 1.23.4
require ( 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 github.com/miekg/dns v1.1.62 // indirect
golang.org/x/mod v0.18.0 // indirect golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.27.0 // indirect golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect golang.org/x/sys v0.22.0 // indirect
golang.org/x/tools v0.22.0 // indirect golang.org/x/tools v0.22.0 // indirect
) )