google / go-react

Apache License 2.0
31 stars 3 forks source link

app-editor doesn't build type mismatch #1

Closed jlewi closed 1 year ago

jlewi commented 1 year ago

When I try to build the example I get a syntax error.

go build github.com/google/go-react/examples/app-editor
# github.com/google/go-react/examples/app-editor
# github.com/google/go-react/examples/app-editor
examples/app-editor/toy_tool_set.go:81:8: cannot use func(ctx context.Context, input string) (string, error) {…} (value of type func(ctx context.Context, input string) (string, error)) as func(ctx context.Context, input string) (any, error) value in struct literal
examples/app-editor/toy_tool_set.go:95:8: cannot use func(ctx context.Context, input string) (string, error) {…} (value of type func(ctx context.Context, input string) (string, error)) as func(ctx context.Context, input string) (any, error) value in struct literal
examples/app-editor/toy_tool_set.go:116:8: cannot use func(ctx context.Context, input string) (string, error) {…} (value of type func(ctx context.Context, input string) (string, error)) as func(ctx context.Context, input string) (any, error) value in struct literal
examples/app-editor/toy_tool_set.go:149:8: cannot use func(ctx context.Context, input string) (string, error) {…} (value of type func(ctx context.Context, input string) (string, error)) as func(ctx context.Context, input string) (any, error) value in struct literal
examples/app-editor/toy_tool_set.go:188:8: cannot use func(ctx context.Context, input string) (string, error) {…} (value of type func(ctx context.Context, input string) (string, error)) as func(ctx context.Context, input string) (any, error) value in struct literal

I suspect this is the result of https://github.com/google/go-react/commit/643efbe8af3c57eb15d6c05ab1515c8eb170bc3d which changed the signature of the Run function to return (any, error). So looks like the fix is to just update the function declarations in https://github.com/google/go-react/blob/main/examples/app-editor/toy_tool_set.go

But maybe I'm missing something