Fix: return copylock value
This commit is contained in:
parent
f8d018c777
commit
9339d3f433
10
main.go
10
main.go
@ -100,10 +100,10 @@ func parseDomain(domain string, entry *Entry) error {
|
||||
return errors.New("Invalid format: " + domain)
|
||||
}
|
||||
|
||||
func parseAttribute(attr string) (router.Domain_Attribute, error) {
|
||||
func parseAttribute(attr string) (*router.Domain_Attribute, error) {
|
||||
var attribute router.Domain_Attribute
|
||||
if len(attr) == 0 || attr[0] != '@' {
|
||||
return attribute, errors.New("invalid attribute: " + attr)
|
||||
return &attribute, errors.New("invalid attribute: " + attr)
|
||||
}
|
||||
|
||||
attr = attr[0:]
|
||||
@ -115,11 +115,11 @@ func parseAttribute(attr string) (router.Domain_Attribute, error) {
|
||||
attribute.Key = strings.ToLower(parts[0])
|
||||
intv, err := strconv.Atoi(parts[1])
|
||||
if err != nil {
|
||||
return attribute, errors.New("invalid attribute: " + attr + ": " + err.Error())
|
||||
return &attribute, errors.New("invalid attribute: " + attr + ": " + err.Error())
|
||||
}
|
||||
attribute.TypedValue = &router.Domain_Attribute_IntValue{IntValue: int64(intv)}
|
||||
}
|
||||
return attribute, nil
|
||||
return &attribute, nil
|
||||
}
|
||||
|
||||
func parseEntry(line string) (Entry, error) {
|
||||
@ -140,7 +140,7 @@ func parseEntry(line string) (Entry, error) {
|
||||
if err != nil {
|
||||
return entry, err
|
||||
}
|
||||
entry.Attrs = append(entry.Attrs, &attr)
|
||||
entry.Attrs = append(entry.Attrs, attr)
|
||||
}
|
||||
|
||||
return entry, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user