We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Summary:
main.go
Detailed example:
outer.go:
outer.go
package outer import "ftl/outer/inner" //ftl:data export type Event struct { Value inner.EchoResponse }
inner.go:
inner.go
package inner import ( "context" "fmt" "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK. ) //ftl:data export type EchoRequest struct { Name ftl.Option[string] `json:"name"` } //ftl:data export type EchoResponse struct { Message string `json:"message"` } //ftl:verb export func Echo(ctx context.Context, req EchoRequest) (EchoResponse, error) { return EchoResponse{Message: fmt.Sprintf("Hello, %s!", req.Name.Default("anonymous"))}, nil }
Building this module generates .ftl/go/main/main.go:
.ftl/go/main/main.go
// Code generated by FTL. DO NOT EDIT. package main import ( "context" "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect" "github.com/TBD54566975/ftl/common/plugin" "github.com/TBD54566975/ftl/go-runtime/server" "ftl/outer" "ftl/outer/inner" ) func main() { verbConstructor := server.NewUserVerbServer("outer", server.HandleCall(inner.Echo), ) plugin.Start(context.Background(), "outer", verbConstructor, ftlv1connect.VerbServiceName, ftlv1connect.NewVerbServiceHandler) }
Which results in the error: ./main.go:11:2: "ftl/outer" imported and not used
./main.go:11:2: "ftl/outer" imported and not used
The text was updated successfully, but these errors were encountered:
fix: Unable to build module without verbs with a subpackage that has …
4b7a99b
…verbs fixes #2148
3b4885f
1cec75e
worstell
Successfully merging a pull request may close this issue.
Summary:
main.go
imports the module package but then doesn't use itDetailed example:
outer.go
:inner.go
:Building this module generates
.ftl/go/main/main.go
:Which results in the error:
./main.go:11:2: "ftl/outer" imported and not used
The text was updated successfully, but these errors were encountered: