XTLS / libXray

MIT License
64 stars 57 forks source link

why go.sum listed in .gitignore file? #18

Closed SaeedDev94 closed 7 months ago

SaeedDev94 commented 7 months ago

As my understanding go.sum is like npm package-lock.json which guarantees the dependencies versions be exactly same as author machine
Why it listed in .gitignore file?
When i run go mod download to install dependencies go command updates libs so I have to commit the changes (go.mod) which I don't want to do it!
I saw other go repos that contains this file
Please include it if there is no specific reason for that, Thanks

yiguous commented 7 months ago

There is no need to do this. If you use build.sh to compile libXray, it will delete the go.mod file and always use the latest Xray-core version. You can find the codes here:

prepare_go() {

SaeedDev94 commented 7 months ago

There is no need to do this. If you use build.sh to compile libXray, it will delete the go.mod file and always use the latest Xray-core version. You can find the codes here:

prepare_go() {

@yiguous The Xray-core version isn't the problem at all, the problem is updating go.mod after running the build script, it should install the dependencies without updating any files IMO

yiguous commented 7 months ago

I know what you mean. If I remove go.sum from .ignore file, the updating of dependencies will depend on when I build the libXray. It is an annoying job. And I always use latest Xray-core version when developing libXray, so there is no difference between what I do and what you say. The dependencies will be updated frequently.

SaeedDev94 commented 7 months ago

I know what you mean. If I remove go.sum from .ignore file, the updating of dependencies will depend on when I build the libXray. It is an annoying job. And I always use latest Xray-core version when developing libXray, so there is no difference between what I do and what you say. The dependencies will be updated frequently.

@yiguous Let me give you an example
I as a developer using libXray for my own app and I create a tag for my repo (ex v2.0.0)
If someone wants to build my app from its source for v2.0.0 (git checkout v2.0.0) the output build wouldn't be same as I build it and upload it to my repo releases (build's md5sum definitely would be different)

yiguous commented 7 months ago

OK. I see it. I will remove go.sum from .ignore file and publish a new tag.