# github.com/libdns/netcup
/root/go/pkg/mod/github.com/libdns/netcup@v0.1.0/util.go:27:14: cannot use record.Priority (variable of type int) as uint value in struct literal
/root/go/pkg/mod/github.com/libdns/netcup@v0.1.0/util.go:43:17: cannot use record.Priority (variable of type uint) as int value in struct literal
// Converts netcup records to libdns records. Since the netcup records don't have individual TTLs, the given TTL is used for all libdns rec
ords.
func toLibdnsRecords(netcupRecords []dnsRecord, ttl int64) []libdns.Record {
var libdnsRecords []libdns.Record
for _, record := range netcupRecords {
libdnsRecord := libdns.Record{
ID: record.ID,
Type: record.RecType,
Name: record.HostName,
Value: record.Destination,
TTL: time.Duration(ttl * int64(time.Second)),
Priority: record.Priority,
}
libdnsRecords = append(libdnsRecords, libdnsRecord)
}
return libdnsRecords
}
// Converts libdns records to netcup records.
func toNetcupRecords(libnsRecords []libdns.Record) []dnsRecord {
var netcupRecords []dnsRecord
for _, record := range libnsRecords {
netcupRecord := dnsRecord{
ID: record.ID,
HostName: record.Name,
RecType: record.Type,
Destination: record.Value,
Priority: record.Priority,
}
netcupRecords = append(netcupRecords, netcupRecord)
}
return netcupRecords
}
How I solve this build error:
in func toLibdnsRecords I change record.Priority to uint(record.Priority)
in func toNetcupRecords I change record.Priority to int(record.Priority)
Hello :)
My current caddy build:
https://github.com/Monviech/os-caddy-plugin/blob/main/usr/local/bin/README.md#current-build
Error I'm getting:
How I solve this build error:
func toLibdnsRecords
I changerecord.Priority
touint(record.Priority)
func toNetcupRecords
I changerecord.Priority
toint(record.Priority)
Then the build works for me.