fix module replacement and database configuration (#54) fix module replace replace all of the module path use seata.apache.org/seata-go
fix module replacement and database configuration (#54)
fix module replace
replace all of the module path
use seata.apache.org/seata-go
Start the seata-server service with the docker file under the /dockercomposer folder
git clone https://seata.apache.org/seata-go-samples.git
cd dockercompose
docker-compose -f docker-compose.yml up -d seata-server
Start and run a sample, for example let’s run a basic distributed transaction sample of AT
cd at/basic
go run .
The default mysql connection configuration is suitable with dockercompose/docker-compose.yml.
You can also customize it by system environment.
System Env Supported:
Modify the seata-go dependency version to v0.0.0-incompatible, and remove the version number if it exists in the original dependency path.
//seata.apache.org/seata-go v1.2.0 seata.apache.org/seata-go v0.0.0-incompatibl
Find the absolute or relative path to your local code.
/Users/mac/Desktop/GO/seata-go ../seata-go
Add the replace module to the go.mod file and change it to the local code path.
seata.apache.org/seata-go => ../seata-go
Synchronization dependencies.
go mod tidy
Run the sample test code.
You can use your local project forked to test new pr that haven’t merged into seata.apache.org/seata-go.
Make sure your go version is 1.18 or later.
Fork and download two projects (seata-go and seata-go-samples), and put them into a same local directory.
For examples:
/Users/xxx/code/github.com/yourid/seata-go /Users/xxx/code/github.com/yourid/seata-go-samples
cd /Users/xxx/code/github.com/yourid
go work init
You will find a go.work file in /Users/xxx/code/github.com/yourid.
go work use ./seata-go
go work use ./seata-go-samples
Now, the content of go.work file is as follows.
go 1.19 use ( ./seata-go ./seata-go-samples )
seata-go-samples
seata-go-samples
How to run samples
Start the seata-server service with the docker file under the /dockercomposer folder
Start and run a sample, for example let’s run a basic distributed transaction sample of AT
Customize mysql connection configurations
The default mysql connection configuration is suitable with dockercompose/docker-compose.yml.
You can also customize it by system environment.
System Env Supported:
How to use go mod replace to test samples for new PR
Modify the seata-go dependency version to v0.0.0-incompatible, and remove the version number if it exists in the original dependency path.
Find the absolute or relative path to your local code.
Add the replace module to the go.mod file and change it to the local code path.
Synchronization dependencies.
Run the sample test code.
How to use go workspace to test samples for new PR (Recommended)
You can use your local project forked to test new pr that haven’t merged into seata.apache.org/seata-go.
Make sure your go version is 1.18 or later.
Fork and download two projects (seata-go and seata-go-samples), and put them into a same local directory.
For examples:
You will find a go.work file in /Users/xxx/code/github.com/yourid.
Now, the content of go.work file is as follows.