Skip to content

Commit ccb90a5

Browse files
committed
code: get rid of pkg/errors (obsoletes #97)
1 parent fcd7717 commit ccb90a5

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ require (
66
github.com/fhs/gompd/v2 v2.3.0
77
github.com/gotk3/gotk3 v0.6.5-0.20240618185848-ff349ae13f56
88
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
9-
github.com/pkg/errors v0.9.1
109
)

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ github.com/gotk3/gotk3 v0.6.5-0.20240618185848-ff349ae13f56 h1:eR+xxC8qqKuPMTucZ
44
github.com/gotk3/gotk3 v0.6.5-0.20240618185848-ff349ae13f56/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
55
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=
66
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
7-
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

internal/player/connector.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
package player
1717

1818
import (
19-
"github.com/fhs/gompd/v2/mpd"
20-
"github.com/pkg/errors"
19+
"fmt"
20+
2121
"sort"
2222
"sync"
2323
"time"
24+
25+
"github.com/fhs/gompd/v2/mpd"
2426
)
2527

2628
// Connector encapsulates functionality for connecting to MPD and watch for its changes
@@ -211,7 +213,7 @@ func (c *Connector) doConnect(connect, heartbeat bool) {
211213
if client, err = mpd.DialAuthenticated(c.mpdNetwork, c.mpdAddress, c.mpdPassword); err == nil {
212214
connected = true
213215
} else {
214-
err = errors.Errorf("DialAuthenticated() failed: %v", err)
216+
err = fmt.Errorf("DialAuthenticated() failed: %v", err)
215217
}
216218
}
217219

@@ -230,7 +232,7 @@ func (c *Connector) doConnect(connect, heartbeat bool) {
230232
go func() { c.chWatcherStart <- true }()
231233
} else {
232234
connected = false
233-
err = errors.Errorf("Status() after dial failed: %v", err)
235+
err = fmt.Errorf("Status() after dial failed: %v", err)
234236
// Disconnect since we're not "fully connected"
235237
errCheck(client.Close(), "doConnect(): Close() failed")
236238
}
@@ -243,7 +245,7 @@ func (c *Connector) doConnect(connect, heartbeat bool) {
243245
if status, err = client.Status(); err == nil {
244246
connected = true
245247
} else {
246-
err = errors.Errorf("Status() failed: %v", err)
248+
err = fmt.Errorf("Status() failed: %v", err)
247249
}
248250
})
249251

internal/player/main-window.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ package player
1818
import (
1919
"C"
2020
"bytes"
21+
"errors"
2122
"fmt"
22-
"github.com/fhs/gompd/v2/mpd"
23-
"github.com/gotk3/gotk3/gdk"
24-
"github.com/gotk3/gotk3/glib"
25-
"github.com/gotk3/gotk3/gtk"
26-
"github.com/pkg/errors"
27-
"github.com/yktoo/ymuse/internal/config"
28-
"github.com/yktoo/ymuse/internal/util"
2923
"html"
3024
"html/template"
3125
"path"
3226
"sort"
3327
"strconv"
3428
"strings"
3529
"time"
30+
31+
"github.com/fhs/gompd/v2/mpd"
32+
"github.com/gotk3/gotk3/gdk"
33+
"github.com/gotk3/gotk3/glib"
34+
"github.com/gotk3/gotk3/gtk"
35+
"github.com/yktoo/ymuse/internal/config"
36+
"github.com/yktoo/ymuse/internal/util"
3637
)
3738

3839
// MainWindow represents the main application window

0 commit comments

Comments
 (0)