Skip to content

Commit

Permalink
[Go] Use protojson instead. (#33718)
Browse files Browse the repository at this point in the history
Co-authored-by: lostluck <[email protected]>
  • Loading branch information
lostluck and lostluck authored Jan 22, 2025
1 parent 8e75484 commit 6c73723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdks/go/pkg/beam/core/runtime/graphx/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package graphx

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"
Expand All @@ -35,6 +34,7 @@ import (
"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
pipepb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/pipeline_v1"
"github.com/apache/beam/sdks/v2/go/pkg/beam/options/resource"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/durationpb"
)
Expand Down Expand Up @@ -125,7 +125,7 @@ func CreateEnvironment(ctx context.Context, urn string, extractEnvironmentConfig
case URNEnvProcess:
config := extractEnvironmentConfig(ctx)
payload := &pipepb.ProcessPayload{}
if err := json.Unmarshal([]byte(config), payload); err != nil {
if err := protojson.Unmarshal([]byte(config), payload); err != nil {
return nil, fmt.Errorf("unable to json unmarshal --environment_config: %w", err)
}
serializedPayload = protox.MustEncode(payload)
Expand Down

0 comments on commit 6c73723

Please sign in to comment.