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
demandé il y a 3 mois109 vues
1 réponse
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
EXPERT
répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions