Skip to content

Commit 6e3947c

Browse files
committed
Unmarshal just does the right thing
1 parent bc21142 commit 6e3947c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/launchservices/plist.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ func ReadPlist(path string) (Plist, error) {
5656
if err != nil {
5757
return p, err
5858
}
59-
plistFile, err := os.Open(path)
59+
data, err := os.ReadFile(path)
6060
if err != nil {
6161
return p, err
6262
}
63-
defer plistFile.Close()
6463

65-
err = plist.NewBinaryDecoder(plistFile).Decode(&p)
64+
err = plist.Unmarshal(data, &p)
6665
if err != nil {
6766
return p, err
6867
}

0 commit comments

Comments
 (0)