apache / incubator-seata-go-samples

Samples for seata-go
https://seata.apache.org/
Apache License 2.0
32 stars 24 forks source link

Run errors out due to incorrect path reference #45

Closed smiletrl closed 10 months ago

smiletrl commented 10 months ago

Run this repo locally

What happened:

According to How to run samples, step 2 produces such errors:

This error happens due to the run command

smiletrl@Rulins-MacBook-Pro basic % go run main.go
# command-line-arguments
./main.go:38:2: undefined: sampleInsert
./main.go:41:2: undefined: sampleInsertOnUpdate
./main.go:44:2: undefined: sampleSelectForUpdate

This error happens due to incorrect conf file path.

smiletrl@Rulins-MacBook-Pro basic % go run .
panic: open /Users/smiletrl/go/src/jihulab.com/yanlin/incubator-seata-go-samples-backup/at/basic/conf/seatago.yml: no such file or directory

goroutine 1 [running]:
github.com/seata/seata-go/pkg/client.newLoaderConf({0x1007f3aed, 0x12})
    /Users/smiletrl/go/src/pkg/mod/github.com/seata/seata-go@v1.0.3/pkg/client/config.go:211 +0x168
github.com/seata/seata-go/pkg/client.LoadPath({0x1007f3aed?, 0x3651f68e40dee935?})
    /Users/smiletrl/go/src/pkg/mod/github.com/seata/seata-go@v1.0.3/pkg/client/config.go:123 +0xbb
github.com/seata/seata-go/pkg/client.InitPath({0x1007f3aed?, 0xc0ffffffff?})
    /Users/smiletrl/go/src/pkg/mod/github.com/seata/seata-go@v1.0.3/pkg/client/client.go:40 +0x1e
main.main()
    /Users/smiletrl/go/src/jihulab.com/yanlin/incubator-seata-go-samples-backup/at/basic/main.go:33 +0x37
exit status 2

What you expected to happen:

no error happens

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

one PR for this issue: https://github.com/apache/incubator-seata-go-samples/pull/44

wt-better commented 10 months ago

Tcc and Xa also has this problem, could you fix in one request, keep fixed unity

smiletrl commented 10 months ago

ah, sure

smiletrl commented 10 months ago

@wt-better Once maintainer approves this PR, I can create follow prs to update other directories. At this moment, I'm not sure whether this pr's approach is suitable ^

smiletrl commented 10 months ago

PR merged