Skip to content

Commit

Permalink
Merge branch 'fix-dependency-issues'
Browse files Browse the repository at this point in the history
  • Loading branch information
shivas committed Dec 16, 2023
2 parents 83a4e08 + 2819f96 commit 0e4a03a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 55 deletions.
6 changes: 3 additions & 3 deletions cmd/abyss-blackbox/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package main

import (
"log/slog"
"os"

"golang.org/x/exp/slog"

"github.com/shivas/abyss-blackbox/internal/app"
)

func main() {
slog.SetDefault(slog.New(slog.HandlerOptions{Level: slog.LevelDebug}.NewTextHandler(os.Stdout)))
logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug}))
slog.SetDefault(logger)

err := app.Run()
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/shivas/abyss-blackbox

go 1.19
go 1.21

require (
github.com/disintegration/gift v1.2.1
Expand All @@ -9,13 +9,13 @@ require (
github.com/lxn/win v0.0.0-20210218163916-a377121e959e
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/shivas/go-windows-hlp v0.1.0
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
golang.org/x/sys v0.5.0
google.golang.org/protobuf v1.28.1
golang.org/x/sys v0.15.0
google.golang.org/protobuf v1.31.0
)

require (
golang.org/x/image v0.5.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/image v0.14.0 // indirect
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
)

Expand Down
40 changes: 8 additions & 32 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/shivas/go-windows-hlp v0.1.0 h1:XhmyLPAoGRE1TUltSbZkacdTeqlXk3MY7pX+2OCxDfc=
Expand All @@ -13,42 +14,17 @@ github.com/shivas/walk v0.0.0-20210212094857-c0397ac21ff8 h1:XfZohVxBfVEqR8waXYF
github.com/shivas/walk v0.0.0-20210212094857-c0397ac21ff8/go.mod h1:mApxRmv/+YmW2b+EFVr2Ve7hhrxDicu73W+uP7Za+VE=
github.com/shivas/win v0.0.0-20210625114026-3e83f2d215c6 h1:8rO0BcQ2beWFsbGqFOsJVF4ABpQlkPGFB/cw9RXILws=
github.com/shivas/win v0.0.0-20210625114026-3e83f2d215c6/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI=
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.5.0 h1:5JMiNunQeQw++mMOz48/ISeNu3Iweh/JaZU8ZLqHRrI=
golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc=
gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E=
2 changes: 1 addition & 1 deletion internal/app/api/client/http-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package client

import (
"fmt"
"log/slog"
"net/http"

"github.com/shivas/abyss-blackbox/internal/app/domain"
"github.com/shivas/abyss-blackbox/internal/version"
"golang.org/x/exp/slog"
)

const agent = "abyssal.space blackbox recorder %s"
Expand Down
28 changes: 18 additions & 10 deletions internal/app/wiring.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"errors"
"fmt"
"image"
"log"
"log/slog"
"os"

"github.com/lxn/walk"
"golang.org/x/exp/slog"

"github.com/shivas/abyss-blackbox/internal/app/api/client"
"github.com/shivas/abyss-blackbox/internal/app/domain"
Expand Down Expand Up @@ -248,7 +248,8 @@ func Run() (err error) {
defer func() {
err = config.Write(currentSettings)
if err != nil {
log.Fatalf("failed to save settings after main window close: %v", err)
slog.Error("failed to save settings after main window close: %v", err)
os.Exit(1)
}
}()

Expand All @@ -262,38 +263,45 @@ func createNotificationIcon(mw *walk.MainWindow) *walk.NotifyIcon {
// We load our icon from a file.
icon, err := walk.Resources.Icon("7")
if err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

// Create the notify icon and make sure we clean it up on exit.
ni, err := walk.NewNotifyIcon(mw)
if err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

// Set the icon and a tool tip text.
if err := ni.SetIcon(icon); err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

if err := ni.SetToolTip("Click for info or use the context menu to exit."); err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

// We put an exit action into the context menu.
exitAction := walk.NewAction()
if err := exitAction.SetText("E&xit"); err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

exitAction.Triggered().Attach(func() { walk.App().Exit(0) })

if err := ni.ContextMenu().Actions().Add(exitAction); err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

if err := ni.SetVisible(true); err != nil {
log.Fatal(err)
slog.Error(err.Error())
os.Exit(1)
}

return ni
Expand Down
3 changes: 1 addition & 2 deletions internal/fittings/provider/tracker-provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"log/slog"
"net/http"

"golang.org/x/exp/slog"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/mainwindow/custom_widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mainwindow
import (
"image"
"image/color"
"log/slog"
"os"
"time"

Expand All @@ -11,7 +12,6 @@ import (
"github.com/lxn/win"
"github.com/shivas/abyss-blackbox/internal/config"
"github.com/shivas/abyss-blackbox/internal/screen"
"golang.org/x/exp/slog"
)

func CustomWidgetDrawLoop(
Expand Down
2 changes: 1 addition & 1 deletion internal/mainwindow/fittings_dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"fmt"
"log"
"log/slog"
"sort"
"time"

"github.com/lxn/walk"
. "github.com/lxn/walk/declarative" //nolint:stylecheck,revive // we needs side effects
"github.com/shivas/abyss-blackbox/internal/fittings"
"golang.org/x/exp/slog"

fittingspb "github.com/shivas/abyss-blackbox/internal/fittings/pb"
)
Expand Down

0 comments on commit 0e4a03a

Please sign in to comment.