Skip to content

pkg/guid: make code windows-only#193

Closed
thaJeztah wants to merge 1 commit intomicrosoft:masterfrom
thaJeztah:fix_non_windows_guid
Closed

pkg/guid: make code windows-only#193
thaJeztah wants to merge 1 commit intomicrosoft:masterfrom
thaJeztah:fix_non_windows_guid

Conversation

@thaJeztah
Copy link
Copy Markdown
Contributor

relates to microsoft/hcsshim#941 (comment) and microsoft/hcsshim#942

When attempting to update go modules in a project, "go get" failed, because the pkg/guid package contained Windows-only code, but was not marked as "windows-only", resulting in the following error:

GO111MODULE=on go get github.com/Microsoft/hcsshim@v0.8.14
....
package github.com/Microsoft/hcsshim
    imports github.com/Microsoft/go-winio/pkg/guid
    imports golang.org/x/sys/windows: build constraints exclude all Go files in /go/pkg/mod/golang.org/x/sys@v0.0.0-20201201145000-ef89a241ccb3/windows

This patch marks the code as "windows-only", excluding it from other platforms. A "doc.go" file was added so that the package is not considered "empty" on other platforms.

When attempting to update go modules in a project, "go get" failed, because the
pkg/guid package contained Windows-only code, but was not marked as "windows-only",
resulting in the following error:

    GO111MODULE=on go get github.com/Microsoft/hcsshim@v0.8.14
    ....
    package github.com/Microsoft/hcsshim
        imports github.com/Microsoft/go-winio/pkg/guid
        imports golang.org/x/sys/windows: build constraints exclude all Go files in /go/pkg/mod/golang.org/x/sys@v0.0.0-20201201145000-ef89a241ccb3/windows

This patch marks the code as "windows-only", excluding it from other platforms.
A "doc.go" file was added so that the package is not considered "empty" on other
platforms.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Contributor Author

@dcantah @kevpar ptal

@thaJeztah
Copy link
Copy Markdown
Contributor Author

Oh! I see #191 appears to be fixing the same issue (but didn't add a doc.go)

@thaJeztah
Copy link
Copy Markdown
Contributor Author

Right, so there's indeed other packages that have the same problem. I'll comment on that PR

@thaJeztah thaJeztah closed this Feb 9, 2021
@thaJeztah thaJeztah deleted the fix_non_windows_guid branch March 2, 2021 08:56
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.

1 participant