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

Fix Windows compatibility for v5 #242

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Fix Windows compatibility for v5 #242

merged 1 commit into from
Nov 29, 2021

Conversation

programmer04
Copy link
Contributor

Currently, version v5 of the library cannot be used on Windows, let's try

go test ./statsd

ends

# github.com/DataDog/datadog-go/v5/statsd [github.com/DataDog/datadog-go/v5/statsd.test]
statsd\statsd.go:264:25: too many arguments in call to newUDSWriter
        have (string, time.Duration)
        want (string)
statsd\uds_windows.go:8:33: undefined: io
FAIL    github.com/DataDog/datadog-go/v5/statsd [build failed]
FAIL

This PR fixes it, by

  • adding missing import io (change has been already proposed by Fix missing import #241, thanks @evanj)
  • updating arguments expected by newUDSWriter for Windows
  • increasing timeouts (I run it on flaky Windows VM with limited resources and original timeouts weren't sufficient, I've seen similar fix Fix flaky test on slow runner #239)

In the future could you add CI testing on Windows too? It'll allow catching quickly such things before releases and save your time. Moreover, I recommend including macOS too, even if the library hasn't had this problem. I know that both systems are mostly Unix like and should be compatible, but some differences may exist (e.g. I stumbled in my project on the fact that Linux has syscall gettid and macOS doesn't). Errors may appear in the future so it's better to be extra cautious.

@hush-hush hush-hush merged commit 8cf6183 into DataDog:master Nov 29, 2021
@hush-hush hush-hush mentioned this pull request Nov 29, 2021
@hush-hush
Copy link
Member

Thanks for the PR !

@programmer04 programmer04 deleted the win-fix branch November 29, 2021 17:39
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

2 participants