CDK Go package includes

0

Folks, given the following seemingly normal project setup, cdk-deploy all fails, it is unable to locate the files.

./our_company.go:

package main
func main() {
   SomeStack(app, "SomeStack", &StackProps{})
}

./somestack.go:

package main
func SomeStack(scope constructs.Construct, id string, props *StackProps) awscdk.Stack {}

No issues in Goland, its a simple main package with functions spread across files.

cdk fails:

$ cdk deploy -all
./our_company.go:1262:2: undefined: SomeStack
V
質問済み 3ヶ月前109ビュー
1回答
1
  • Ensure both our_company.go and somestack.go are in the same directory.
  • Running go build might provide additional context or a more detailed error message, helping you understand why the CDK thinks SomeStack is undefined. When you run the go build or go run commands, make sure to include all relevant files. For example:
go build our_company.go somestack.go
go run .

If this has answered your question or was helpful, accepting the answer would be greatly appreciated. Thank you!

profile picture
エキスパート
回答済み 3ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ