-
Notifications
You must be signed in to change notification settings - Fork 824
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
Build go function fails if there are more than main.go in src #13725
Comments
Hey @nam-truong-le, thank you for reaching out. Marking as bug for further investigation. |
Hey @nam-truong-le, wanted update on this issue. With the latest update to the Lambda functions on #13671. On a quick test with the following steps the push did not run into an error on a new function
// <function-name>/src/test/test.go
package test
import (
"fmt"
)
func DoSomething() {
fmt.Println("Hello World!")
} in // <function-name>/src/main.go
package main
import (
"fmt"
"context"
"github.com/aws/aws-lambda-go/lambda"
test "lambda/test"
)
type MyEvent struct {
Name string `json:"name"`
}
func HandleRequest(ctx context.Context, name MyEvent) (string, error) {
return fmt.Sprintf("Hello %s!", name.Name ), nil
}
func main() {
test.DoSomething()
lambda.Start(HandleRequest)
} |
@ykethan which version of |
@nam-truong-le this is on the latest version of Amplify CLI: 12.11.1 |
I use the same version of CLI but I get this:
As you can see, the build command is |
Hey @nam-truong-le, could you provide us the reproduction steps or sample snippets of the example with the file paths used to reproduce the issue? |
I am experiencing the same issue with my Go Lambda functions. In my case I have multiple files in my main package. I'm using the 12.1.1 version of the CLI on Ubuntu 20.04.6 LTS. This are the steps taken to reproduce:
2 - On
3 - Running
If the command changed from |
Hey @jo-su, thank you for the information. I was able to reproduce the issue. Marking a bug.
Noticed an error |
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
20
Amplify CLI Version
12.11.1
What operating system are you using?
Ubuntu
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
This change here fails go function build if there are more than main.go in src.
Expected behavior
Go function should be built
Reproduction steps
Project Identifier
No response
Log output
No response
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: