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: Fix module name for Go #269

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Jul 31, 2024

Motivation

Right now the Go module name configured is wrong. It doesn't include the path inside the directory: dist/go. As a result, in a Go project, when I tried to install this package, I got an error:

yiming.luo@COMP-J7WRL6274T go-hello % go get -u github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct
go: github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct@upgrade (v0.0.0-20240731210442-cae5a5626d82) requires github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct@v0.0.0-20240731210442-cae5a5626d82: parsing go.mod:
	module declares its path as: github.com/DataDog/datadog-cdk-constructs/ddcdkconstruct
	        but was required as: github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct

What does this PR do?

Fix this error by adding dist/go to the module name.

Testing Guidelines

Steps

  1. Push this commit to a new branch yiming.luo/support-golang
  2. In the Go project, install the package from the new branch:
yiming.luo@COMP-J7WRL6274T go-hello % go get -u github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct@yiming.luo/support-golang
go: downloading github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct v0.0.0-20240731215958-5319883dbd9d
go: added github.com/DataDog/datadog-cdk-constructs/dist/go/ddcdkconstruct v0.0.0-20240731215958-5319883dbd9d
go: added github.com/Masterminds/semver/v3 v3.2.1
go: added github.com/aws/aws-cdk-go/awscdk/v2 v2.150.0
go: added github.com/aws/constructs-go/constructs/v10 v10.3.0
go: added github.com/aws/jsii-runtime-go v1.101.0
go: added github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202
go: added github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2
go: added github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.3

Result

As shown above, the package was found and installed successfully.

Additional Notes

After the package is installed, there are still some errors when I try to use the package in the Go app. I'd like to test again after this PR is merged to main.

Related Feature Request: Datadog CDK Construct for Go

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@lym953 lym953 requested a review from a team as a code owner July 31, 2024 22:09
@lym953 lym953 changed the title Fix module name for Go fix: Fix module name for Go Jul 31, 2024
@lym953 lym953 force-pushed the yiming.luo/support-golang branch from 5319883 to 6da3da5 Compare July 31, 2024 22:13
@lym953 lym953 linked an issue Aug 1, 2024 that may be closed by this pull request
@lym953
Copy link
Contributor Author

lym953 commented Aug 1, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 1, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 4m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 5bce51e into main Aug 1, 2024
13 checks passed
@dd-mergequeue dd-mergequeue bot deleted the yiming.luo/support-golang branch August 1, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go support
2 participants