Skip to content

Use golang.org/x/sys#22

Merged
danieljoos merged 1 commit intodanieljoos:masterfrom
crazy-max:sys
Aug 20, 2021
Merged

Use golang.org/x/sys#22
danieljoos merged 1 commit intodanieljoos:masterfrom
crazy-max:sys

Conversation

@crazy-max
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@danieljoos ptal 🤗

return syscall.StringToUTF16(str)
res, err := syscall.UTF16FromString(str)
if err != nil {
return []uint16{}
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

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

@crazy-max crazy-max force-pushed the sys branch 3 times, most recently from 29ac408 to 5bb5bb3 Compare August 20, 2021 07:59
@crazy-max
Copy link
Copy Markdown
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.

3 participants