mirror of
https://github.com/v2fly/domain-list-community.git
synced 2024-11-16 17:14:52 +02:00
Fix: colon exist while no attr at the end of line (#86)
This commit is contained in:
parent
99a1b9f37e
commit
4130e0a5b9
4
main.go
4
main.go
@ -47,10 +47,10 @@ func (l *ParsedList) toPlainText(listName string) error {
|
||||
for _, attr := range entry.Attrs {
|
||||
attrString += "@" + attr.GetKey() + ","
|
||||
}
|
||||
attrString = strings.TrimRight(attrString, ",")
|
||||
attrString = strings.TrimRight(":"+attrString, ",")
|
||||
}
|
||||
// Entry output format is: type:domain.tld:@attr1,@attr2
|
||||
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+":"+attrString+"\n")...)
|
||||
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+attrString+"\n")...)
|
||||
}
|
||||
if err := ioutil.WriteFile(listName+".txt", entryBytes, 0644); err != nil {
|
||||
return fmt.Errorf(err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user