mirror of
https://github.com/safing/portmaster
synced 2025-04-24 04:49:10 +00:00
Update dsd loading to new version
This commit is contained in:
parent
fe098f5371
commit
9185bf5bac
1 changed files with 2 additions and 5 deletions
|
@ -83,14 +83,11 @@ func decodeFile(ctx context.Context, r io.Reader, ch chan<- *listEntry) error {
|
|||
// JSON, BSON or GenCode. So LoadAsFormat MUST return the value
|
||||
// passed as the third parameter. String or RAW encoding IS AN
|
||||
// error here.
|
||||
val, err := dsd.LoadAsFormat(blob, format, &listEntry{})
|
||||
entry := &listEntry{}
|
||||
err := dsd.LoadAsFormat(blob, format, entry)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to decoded DSD encoded entity: %w", err)
|
||||
}
|
||||
entry, ok := val.(*listEntry)
|
||||
if !ok {
|
||||
return fmt.Errorf("unsupported encoding format: %d (%c)", format, format)
|
||||
}
|
||||
|
||||
select {
|
||||
case ch <- entry:
|
||||
|
|
Loading…
Add table
Reference in a new issue