mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
cmd: add a go.local.mod for development
It's essentially a copy of go.mod, but with the gioui.org module replaed with the parent directory. Useful when wanting to try a change in the root module as part of a gogio invocation or end-to-end test, such as either of the following: $ cd cmd; go test -modfile=go.local.mod ./... $ cd cmd/gogio; go build -modfile=../go.local.mod Since go.sum can essentially be shared, and since it seems to work with the go tool, use a symlink. The way the -modfile flag works, if given foo.mod, it will use the sum file at foo.sum. The only caveat is that 'go mod tidy -modfile=go.mod.local' will try to remove gioui.org lines, since that module is replaced. So tidy shouldn't be used with -modfile. In the future, the only upkeep needed for go.local.mod is to update the external dependencies to mirror changes in go.mod. This is not automated nor checked by CI, but it could be in the future if it becomes repetitive or error-prone. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
@@ -46,6 +46,7 @@ tasks:
|
||||
cd gio/cmd
|
||||
go test ./...
|
||||
go test -race ./...
|
||||
go test -modfile=go.local.mod ./...
|
||||
- test_example: |
|
||||
cd gio/example
|
||||
go test -race ./...
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
module gioui.org/cmd
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-00010101000000-000000000000
|
||||
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4
|
||||
github.com/chromedp/chromedp v0.5.2
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58
|
||||
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e
|
||||
)
|
||||
|
||||
replace gioui.org => ../
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
go.sum
|
||||
Reference in New Issue
Block a user