Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CopyCoreVersion #223

Merged
merged 1 commit into from
Jun 25, 2024
Merged

add CopyCoreVersion #223

merged 1 commit into from
Jun 25, 2024

Conversation

xhd2015
Copy link
Owner

@xhd2015 xhd2015 commented Jun 25, 2024

No description provided.

@xhd2015 xhd2015 force-pushed the add-copy-core-version branch from 58d5046 to e64e4df Compare June 25, 2024 06:20
@xhd2015 xhd2015 merged commit e64e4df into master Jun 25, 2024
9 checks passed
@@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest]
go: [ '1.18' ,'1.20','1.21']
go: [ '1.17','1.18','1.19','1.20','1.21']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know 1.22 is the last one right? 😁

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly why it is not here, because this file only tests older go versions. Cutting edge go is tested in another file.
Glad you check the PR so carefully. Thanks a lot. 😊

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment just above the line became it's not obvious when seeing the line changed in a PR


func CopyCoreVersion(xgoVersionFile string, runtimeVersionFile string) error {
// copy xgo's core version to runtime version
code, err := ioutil.ReadFile(xgoVersionFile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You kept ioutil for compatibility purpose?

https://pkg.go.dev/io/ioutil#ReadFile

I don't think you should care about go before 1.16

But if you need it, then please add a comment here about why you are using this deprecated function

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I kept using ioutil for compatibility reason. I expect go1.16 to be the smallest version xgo can support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it recommend a comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wait ioutil was deprecated with 1.16, so?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'll lower the smallest version to go1.14 😼

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then a comment aside the import and one where you call ioutil.ReadFile would be appreciated

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just a joke, the project's runtime/go.mod really says it is targeting go 1.14, so kept here.

Maybe after a year or two we may finally remove this thing.

@xhd2015 xhd2015 deleted the add-copy-core-version branch June 26, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants