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

Use golang.org/x/sys #22

Merged
merged 1 commit into from
Aug 20, 2021
Merged

Use golang.org/x/sys #22

merged 1 commit into from
Aug 20, 2021

Conversation

crazy-max
Copy link
Contributor

@crazy-max crazy-max commented Aug 19, 2021

This PR removes the syscall package to use the golang.org/x/sys one.

As stipulated in https://pkg.go.dev/syscall:

Deprecated: this package is locked down. Callers should use the corresponding package in the golang.org/x/sys repository instead. That is also where updates required by new systems or versions should be applied. See https://golang.org/s/go1.4-syscall for more information.

Also utf16PtrToString has been moved to the native golang.org/x/sys/windows#UTF16PtrToString.

In addition I've updated the workflow to use a matrix against Go 1.14, 1.15, 1.16, 1.17 and also push coverage results to Codacy. The workflow godev.yml has been added to be able to automatically refresh pkg.go.dev doc on new release.

Dependabot has also been added to keep dependencies up to date (gomod and github actions).

Finally, some fancy badges and move to pkg.go.dev for docs.

If you wish I can break this down into several PRs.

@thaJeztah
Copy link

@danieljoos ptal 🤗

return syscall.StringToUTF16(str)
res, err := syscall.UTF16FromString(str)
if err != nil {
return []uint16{}
Copy link
Owner

Choose a reason for hiding this comment

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

I guess this is a slight change in behavior. The old implementation would have panic'ed.
New solution is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes indeed

Copy link
Owner

@danieljoos danieljoos left a comment

Choose a reason for hiding this comment

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

This is awesome.
Thank you very much for this contribution.

@danieljoos
Copy link
Owner

Not sure about these failing builds. Is there something missing in the workflow config?

@crazy-max
Copy link
Contributor Author

@danieljoos Should work now :)

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.

None yet

3 participants