lostluck commented on a change in pull request #16957:
URL: https://github.com/apache/beam/pull/16957#discussion_r837982546



##########
File path: sdks/go/pkg/beam/core/runtime/harness/harness.go
##########
@@ -36,14 +36,27 @@ import (
        "google.golang.org/grpc"
 )
 
+// StatusAddress is a type of status endpoint address as an optional argument 
to harness.Main().
+type StatusAddress string
+
 // TODO(herohde) 2/8/2017: for now, assume we stage a full binary (not a 
plugin).
 
 // Main is the main entrypoint for the Go harness. It runs at "runtime" -- not
 // "pipeline-construction time" -- on each worker. It is a FnAPI client and
 // ultimately responsible for correctly executing user code.
-func Main(ctx context.Context, loggingEndpoint, controlEndpoint string) error {
+func Main(ctx context.Context, loggingEndpoint, controlEndpoint string, 
options ...interface{}) error {
        hooks.DeserializeHooksFromOptions(ctx)
 
+       statusEndpoint := ""
+       for _, option := range options {
+               switch option := option.(type) {
+               case StatusAddress:
+                       statusEndpoint = string(option)
+               default:
+                       return errors.Errorf("unkown type %T, value %v in error 
call", option, option)

Review comment:
       ```suggestion
                        return errors.Errorf("unknown type %T, value %v in 
error call", option, option)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to