Skip to content

Conversation

@thaJeztah
Copy link
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/[email protected]
....
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/[email protected]/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/[email protected]
    ....
    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/[email protected]/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 <[email protected]>
@thaJeztah
Copy link
Contributor Author

@dcantah @kevpar ptal

@thaJeztah
Copy link
Contributor Author

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

@thaJeztah
Copy link
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