Skip to content

Commit

Permalink
Merge pull request #1 from amnuts/location-lookup
Browse files Browse the repository at this point in the history
Location lookup added
  • Loading branch information
amnuts authored Jul 16, 2023
2 parents a044200 + 2d0f5ab commit 526e1e4
Show file tree
Hide file tree
Showing 9 changed files with 335 additions and 43 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@

## About

This is an application built as a personal project using [wails.io](https://wails.io) and react. It is designed to help organise photos into a folder structure based on the date the photo was taken, the folder name, and eventually location details.
This is an application built as a personal project using [wails.io](https://wails.io) and react. It is designed to help organise photos into a folder structure based on the date the photo was taken, the folder name, and location details.

## Here be dragons!

...and I'm not talking about the Wails logo!

This is by no means ready for anyone else to use because it's still in development. And where I'd be crushed if my own photos went missing because of it, I'd really hate it if yours did, too.
This is by no means ready for anyone else to use because it's still in development. And where I'd be crushed if my own photos went missing because of it, I'd really hate it if yours did, too. It is functionally working for me, but I'm still tweaking things and adding features.

However, once it's completed and ready for anyone else to use, I'll change this readme. :smile:

## Still to do
## Recent updates

*Location resolution has been added!*

If any of the placeholders are location-based, it'll do a reverse lookup on the lat/long of the photo and use that information. It's using the OpenStreetMap data, so it's not as accurate as Google Maps, but it's free and doesn't require an API key. One restriction, though, is that there is a 1-request-per-second maximum limit, so if you have a lot of photos all in different locations, it could take a while. There is a SQLite db cache for previously found locations. So if you're like me and take lots of photos in the same place, it'll be a lot quicker.

Location substitution doesn't currently work. I have to find a service that does geolocation lookup based on lat/long, that's free and, ideally, doesn't require an API key.
*Copying and moving now actually work!*

It doesn't actually move/copy anything right now! I'm in the process of making everything work how I want before actively messing with my files.
Previous versions had this functionality commented out, but now it's working. If there is a file with the same name already in the destination, it just won't copy the source file. It prints any issues to the terminal, so you may see some errors there if you have duplicate files, or files couldn't be moved/copied for some reason.

## Still to do

Tidy up the code. It's a bit of a mess right now.
Tidy up the code. It's still a bit of a mess right now.

## Screenshots

Expand Down
31 changes: 25 additions & 6 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package main

import (
"context"
"database/sql"
"fmt"
"github.com/wailsapp/wails/v2/pkg/runtime"
_ "image/jpeg"
_ "image/png"
_ "modernc.org/sqlite"
"os"
"os/exec"
"path/filepath"
Expand All @@ -24,6 +26,7 @@ type App struct {
moveOrCopy string
verifyResults bool
substitutions []Substitution
cache *CacheDatabase
}

type Substitution struct {
Expand All @@ -44,15 +47,30 @@ type RelocationStatus struct {
TotalRelocated int `json:"totalRelocated"`
}

type CacheDatabase struct {
DB *sql.DB
}

// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}

// startup is called when the app starts. The context is saved
// so we can call the runtime methods
// so that we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx

homeDir, _ := os.UserHomeDir()
appStorePath := homeDir + "/photo-organiser"
if _, err := os.Stat(appStorePath); os.IsNotExist(err) {
err := os.Mkdir(appStorePath, 0755)
checkErr(err, fmt.Sprintf("Cannot create required '%s' directory", appStorePath))
}
cacheDb, err := NewCacheDatabase(appStorePath + "/location-cache.db")
checkErr(err, "Failed to initialize location cache database")

a.cache = cacheDb
}

func (a *App) ResetEverything() {
Expand Down Expand Up @@ -141,6 +159,7 @@ func (a *App) GetExamplePathSubstitution(namingConvention string, metadata *Imag

func (a *App) ProcessImages() {
a.substitutions = nil
getLocationDetails := HasLocationPlaceholders(a.namingConvention)
for _, dir := range a.startDirectories {
fmt.Println("Processing directory", dir)
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
Expand All @@ -149,28 +168,28 @@ func (a *App) ProcessImages() {
return err
}
if info.IsDir() || !IsValidExtension(filepath.Ext(path)) {
fmt.Println(" Skipping", path, "because it's a directory or not a valid image")
//fmt.Println(" Skipping", path, "because it's a directory or not a valid image")
return nil
}

// Get all the info we need about the image
imageData, _ := GetImageMetadata(path)
imageData, _ := GetImageMetadata(path, getLocationDetails, a.cache)

// Skip if we're filtering by size and the file is too small
if (a.minSize > 0) && (imageData.FileSize < a.minSize) {
fmt.Println(" Skipping", path, "because it's too small")
//fmt.Println(" Skipping", path, "because it's too small")
return nil
}

// Skip if we're filtering by width and the file is too small
if (a.minWidth > 0) && (imageData.Width < a.minWidth) {
fmt.Println(" Skipping", path, "because it's too narrow:", imageData.Width, "<", a.minWidth)
//fmt.Println(" Skipping", path, "because it's too narrow:", imageData.Width, "<", a.minWidth)
return nil
}

// Skip if we're filtering by height and the file is too small
if (a.minHeight > 0) && (imageData.Height < a.minHeight) {
fmt.Println(" Skipping", path, "because it's too short")
//fmt.Println(" Skipping", path, "because it's too short")
return nil
}

Expand Down
75 changes: 75 additions & 0 deletions cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package main

import (
"database/sql"
_ "modernc.org/sqlite"
)

func NewCacheDatabase(dbFile string) (*CacheDatabase, error) {
sqliteDb, err := sql.Open("sqlite", dbFile)
if err != nil {
return nil, err
}

cache := &CacheDatabase{DB: sqliteDb}
err = cache.initCache()
if err != nil {
return nil, err
}

return cache, nil
}

func (cache *CacheDatabase) initCache() error {
// Create table if it doesn't exist
createTableSql := `CREATE TABLE IF NOT EXISTS locations (
geohash TEXT PRIMARY KEY,
latitude REAL NOT NULL,
longitude REAL NOT NULL,
country TEXT NOT NULL,
division TEXT NOT NULL,
city TEXT NOT NULL,
place TEXT NOT NULL,
url TEXT NOT NULL
);`

_, err := cache.DB.Exec(createTableSql)
checkErr(err, "Failed to create locations table")

return err
}

func (cache *CacheDatabase) InsertLocation(url string, location GeoLocationMetadata) error {
stmt, err := cache.DB.Prepare("INSERT INTO locations(geohash, latitude, longitude, country, division, city, place, url) VALUES(?, ?, ?, ?, ?, ?, ?, ?)")
_, err = stmt.Exec(location.Geohash, location.Latitude, location.Longitude, location.Country, location.Division, location.City, location.Place, url)
return err
}

func (cache *CacheDatabase) GetLocation(geohash string) (*GeoLocationMetadata, error) {

var rowGeohash string
var rowLatitude float64
var rowLongitude float64
var rowCountry string
var rowDivision string
var rowCity string
var rowPlace string
var rowUrl string

if err := cache.DB.QueryRow("SELECT * FROM locations WHERE geohash = ?", geohash).Scan(&rowGeohash, &rowLatitude, &rowLongitude, &rowCountry, &rowDivision, &rowCity, &rowPlace, &rowUrl); err != nil {
return nil, err
}

var location *GeoLocationMetadata
location = &GeoLocationMetadata{
Geohash: rowGeohash,
Latitude: rowLatitude,
Longitude: rowLongitude,
Country: rowCountry,
Division: rowDivision,
City: rowCity,
Place: rowPlace,
}

return location, nil
}
2 changes: 2 additions & 0 deletions frontend/src/NamingPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ export default function NamingPanel({updateData, canProceed, namingConvention, d
))}
</ul>
</div>

<p className="mt-6 text-xs text-gray-400 text-right">Reverse geolocation data from OpenStreetMap</p>
</div>
</>
);
Expand Down
19 changes: 17 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,47 @@ require (
github.com/mmcloughlin/geohash v0.10.0
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
github.com/wailsapp/wails/v2 v2.5.1
modernc.org/sqlite v1.24.0
)

require (
github.com/bep/debounce v1.2.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/labstack/echo/v4 v4.9.0 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
github.com/leaanthony/gosod v1.0.3 // indirect
github.com/leaanthony/slicer v1.5.0 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/samber/lo v1.27.1 // indirect
github.com/tkrajina/go-reflector v0.5.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/wailsapp/mimetype v1.4.1 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.1.12 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
modernc.org/ccgo/v3 v3.16.13 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/token v1.0.1 // indirect
)

// replace github.com/wailsapp/wails/v2 v2.4.1 => C:\Users\Andrew\go\pkg\mod
46 changes: 43 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3IS
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/labstack/echo/v4 v4.9.0 h1:wPOF1CE6gvt/kmbMR4dGzWvHMPT+sAEUJOwOTtvITVY=
github.com/labstack/echo/v4 v4.9.0/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks=
github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o=
Expand All @@ -25,8 +31,10 @@ github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
github.com/mmcloughlin/geohash v0.10.0 h1:9w1HchfDfdeLc+jFEf/04D27KP7E2QmpDu52wPbJWRE=
github.com/mmcloughlin/geohash v0.10.0/go.mod h1:oNZxQo5yWJh0eMQEP/8hwQuVx9Z9tjwFUqcTB1SmG0c=
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 h1:acNfDZXmm28D2Yg/c3ALnZStzNaZMSagpbr96vY6Zjc=
Expand All @@ -35,6 +43,9 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/samber/lo v1.27.1 h1:sTXwkRiIFIQG+G0HeAvOEnGjqWeWtI9cg5/n51KrxPg=
Expand All @@ -57,6 +68,8 @@ golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM=
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
Expand All @@ -68,14 +81,41 @@ golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/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/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
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.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw=
modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0=
modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw=
modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY=
modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=
modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY=
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
modernc.org/sqlite v1.24.0 h1:EsClRIWHGhLTCX44p+Ri/JLD+vFGo0QGjasg2/F9TlI=
modernc.org/sqlite v1.24.0/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=
modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=
modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY=
modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=
modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"embed"
"log"

"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
Expand Down Expand Up @@ -34,3 +35,9 @@ func main() {
println("Error:", err.Error())
}
}

func checkErr(err error, msg string) {
if err != nil {
log.Fatalln(msg, err)
}
}
Loading

0 comments on commit 526e1e4

Please sign in to comment.