wails
wails copied to clipboard
check a.map before use a.map
when a is a string, a.slice exists but a.map does not. So, I believe it's better to check a.map instead of a.slice before calling a.map.
Thanks for the PR @FrankFang. Are you able to give a little more context or a test showing the bug, and how this fixes it? Many thanks.
And I suggest to add a test case too, if possible.
Newbie here. How could I run tests for wails v2?
Just create a standard go test. Are you familiar with this process?
I am not sure. Could you show me the commands to run tests?
❯❯❯ cd v2
❯❯❯ go test ./...
cmd/wails/internal/commands/generate/template/base/main.tmpl.go:17:12: pattern build/appicon.png: no matching files found
cmd/wails/internal/commands/initialise/templates/base/main.tmpl.go:10:12: pattern frontend/dist: no matching files found
package github.com/wailsapp/wails/v2/internal/frontend/desktop/windows
imports github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32
imports golang.org/x/sys/windows/registry: build constraints exclude all Go files in /root/go/pkg/mod/golang.org/x/[email protected]/windows/registry
package github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/go-webview2/internal/w32
imports golang.org/x/sys/windows: build constraints exclude all Go files in /root/go/pkg/mod/golang.org/x/[email protected]/windows
❯❯❯ go test
? github.com/wailsapp/wails/v2 [no test files]
I run these commands in WSL2 on Windows.
❯❯❯ go version
go version go1.18.5 linux/amd64
Tests should work now 👍
@leaanthony How could I run the tests? Could you show me the commands?
go test ./... in the root directory