Skip to content

Commit

Permalink
gomod: Use
Browse files Browse the repository at this point in the history
  • Loading branch information
echarrod committed Oct 25, 2024
1 parent 1ed2073 commit 934c3b0
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 1,104 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@

# Output of go coverage
*.out

# Go
go.work
go.work.sum
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/luno/jettison v0.0.0-20240722160230-b42bd507a5f6
github.com/sebdah/goldie/v2 v2.5.5
github.com/stretchr/testify v1.9.0
golang.org/x/tools v0.21.0
golang.org/x/tools v0.26.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -16,8 +16,8 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
31 changes: 1 addition & 30 deletions internal/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,6 @@ import (
// Since resulting go.sum will change depending latest bitx dependencies, these copies are deleted afterwards.
// See testdata/example/doc.go for more details.
func TestMain(m *testing.M) {
copies := map[string]string{
"testdata/example/gomod": "testdata/example/go.mod",
"testdata/example/gosum": "testdata/example/go.sum",
}

// Create copies
for actual, expect := range copies {
b, err := os.ReadFile(actual)
if err != nil {
log.Error(nil, errors.Wrap(err, "reading file"))
os.Exit(1)
}

err = os.WriteFile(expect, b, 0o644)
if err != nil {
log.Error(nil, errors.Wrap(err, "writing file"))
os.Exit(1)
}
}

cmd := exec.Command("go", "mod", "tidy")
cmd.Dir = "testdata/example"
cmd.Stdout = os.Stdout
Expand All @@ -57,15 +37,6 @@ func TestMain(m *testing.M) {
}

m.Run()

// Delete copies
for _, expect := range copies {
err := os.Remove(expect)
if err != nil {
log.Error(nil, errors.Wrap(err, "delete"))
os.Exit(1)
}
}
}

func TestGenerate(t *testing.T) {
Expand Down Expand Up @@ -166,7 +137,7 @@ func TestGenerate(t *testing.T) {
ForTesting: test.ForTesting,
})
jtest.RequireNil(t, err)
require.Empty(t, res.Errors)
require.Empty(t, res.Errors, res.Errors[0])

var graph bytes.Buffer
printNode(&graph, res.Root, 0, true)
Expand Down
2 changes: 0 additions & 2 deletions internal/testdata/example/.gitignore

This file was deleted.

30 changes: 7 additions & 23 deletions internal/testdata/example/exchange/exchangepb/exchange.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/testdata/example/exchange/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module exchange
3 changes: 3 additions & 0 deletions internal/testdata/example/exchange/ops/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ops

go 1.23.2
4 changes: 2 additions & 2 deletions internal/testdata/example/exchange/state/adhoc.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package state

import (
"exchange"
"exchange/ops"
"fmt"

"github.com/luno/weld"
"github.com/luno/weld/internal/testdata/example/exchange"
"github.com/luno/weld/internal/testdata/example/exchange/ops"
)

var ChanProvider = weld.NewSet(NewModelChan)
Expand Down
21 changes: 21 additions & 0 deletions internal/testdata/example/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module example

go 1.23.2

replace github.com/luno/weld => ../../../

require (
github.com/luno/jettison v0.0.0-20240722160230-b42bd507a5f6
github.com/luno/weld v0.0.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
)

require (
github.com/go-stack/stack v1.8.1 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
)
32 changes: 32 additions & 0 deletions internal/testdata/example/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
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/luno/jettison v0.0.0-20240722160230-b42bd507a5f6 h1:0s90//MXlAOvp91eNGIoCHf1X0jQ+TcPRlWSuuPREW4=
github.com/luno/jettison v0.0.0-20240722160230-b42bd507a5f6/go.mod h1:cV8KOstEDY+Su4dcN1dadoXC7xmyEqtXAw6Nywia/z8=
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/sebdah/goldie/v2 v2.5.5 h1:rx1mwF95RxZ3/83sdS4Yp7t2C5TCokvWP4TBRbAyEWY=
github.com/sebdah/goldie/v2 v2.5.5/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
12 changes: 0 additions & 12 deletions internal/testdata/example/gomod

This file was deleted.

Loading

0 comments on commit 934c3b0

Please sign in to comment.