mirror of
https://github.com/safing/portmaster
synced 2025-09-02 18:49:14 +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
|
// JSON, BSON or GenCode. So LoadAsFormat MUST return the value
|
||||||
// passed as the third parameter. String or RAW encoding IS AN
|
// passed as the third parameter. String or RAW encoding IS AN
|
||||||
// error here.
|
// error here.
|
||||||
val, err := dsd.LoadAsFormat(blob, format, &listEntry{})
|
entry := &listEntry{}
|
||||||
|
err := dsd.LoadAsFormat(blob, format, entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to decoded DSD encoded entity: %w", err)
|
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 {
|
select {
|
||||||
case ch <- entry:
|
case ch <- entry:
|
||||||
|
|
Loading…
Add table
Reference in a new issue