From 8195175732e0459fae8f52ca1798636e7dc7a374 Mon Sep 17 00:00:00 2001 From: Jusabe Guedes Date: Tue, 18 Jul 2023 11:08:56 +0200 Subject: [PATCH] feat: update sage --- .sage/go.mod | 2 +- .sage/go.sum | 4 ++-- .sage/sagefile.go | 2 +- Makefile | 4 ++-- encoding/protobq/example_test.go | 7 ++++--- encoding/protobq/load_test.go | 4 ++-- internal/examples/proto/Makefile | 4 ++-- .../einride/bigquery/public/v1/dogecoin_transaction.proto | 8 ++++---- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.sage/go.mod b/.sage/go.mod index 246da14..b15de25 100644 --- a/.sage/go.mod +++ b/.sage/go.mod @@ -2,4 +2,4 @@ module sage go 1.17 -require go.einride.tech/sage v0.161.0 +require go.einride.tech/sage v0.229.0 diff --git a/.sage/go.sum b/.sage/go.sum index dcd3e4d..8fc2978 100644 --- a/.sage/go.sum +++ b/.sage/go.sum @@ -1,2 +1,2 @@ -go.einride.tech/sage v0.161.0 h1:TwWlU6djdEtL9dVOSsG9mXbI110I4+REIpZ5CH1/7dY= -go.einride.tech/sage v0.161.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= +go.einride.tech/sage v0.229.0 h1:YMSySmoxZGD1woZTImzH3B543X5wJmAjOTK6elA7iCc= +go.einride.tech/sage v0.229.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= diff --git a/.sage/sagefile.go b/.sage/sagefile.go index 08acba2..62869ed 100644 --- a/.sage/sagefile.go +++ b/.sage/sagefile.go @@ -36,7 +36,7 @@ func All(ctx context.Context) error { func FormatYAML(ctx context.Context) error { sg.Logger(ctx).Println("formatting YAML files...") - return sgyamlfmt.Command(ctx, "-d", sg.FromGitRoot(), "-r").Run() + return sgyamlfmt.Run(ctx) } func GoModTidy(ctx context.Context) error { diff --git a/Makefile b/Makefile index e76d1c7..b4e40e1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Code generated by go.einride.tech/sage. DO NOT EDIT. -# To learn more, see .sage/sagefile.go and https://github.com/einride/sage. +# To learn more, see .sage/main.go and https://github.com/einride/sage. .DEFAULT_GOAL := all @@ -10,7 +10,7 @@ sagefile := $(abspath $(cwd)/.sage/bin/sagefile) go := $(shell command -v go 2>/dev/null) export GOWORK ?= off ifndef go -SAGE_GO_VERSION ?= 1.18.4 +SAGE_GO_VERSION ?= 1.20.2 export GOROOT := $(abspath $(cwd)/.sage/tools/go/$(SAGE_GO_VERSION)/go) export PATH := $(PATH):$(GOROOT)/bin go := $(GOROOT)/bin/go diff --git a/encoding/protobq/example_test.go b/encoding/protobq/example_test.go index e0cd312..85dc3ab 100644 --- a/encoding/protobq/example_test.go +++ b/encoding/protobq/example_test.go @@ -5,6 +5,7 @@ import ( "errors" "flag" "fmt" + "log" "strconv" "cloud.google.com/go/bigquery" @@ -109,7 +110,7 @@ func ExampleMarshal() { } row, err := protobq.Marshal(msg) if err != nil { - // TODO: Handle error. + log.Fatal(err) } expected := map[string]bigquery.Value{ "name": "publishers/123/books/456", @@ -130,7 +131,7 @@ func ExampleUnmarshal() { } msg := &library.Book{} if err := protobq.Unmarshal(row, msg); err != nil { - // TODO: Handle error. + log.Fatal(err) } expected := &library.Book{ Name: "publishers/123/books/456", @@ -157,7 +158,7 @@ func ExampleLoad() { } msg := &library.Book{} if err := protobq.Load(row, schema, msg); err != nil { - // TODO: Handle error. + log.Fatal(err) } expected := &library.Book{ Name: "publishers/123/books/456", diff --git a/encoding/protobq/load_test.go b/encoding/protobq/load_test.go index 73ac90f..9e4c0d8 100644 --- a/encoding/protobq/load_test.go +++ b/encoding/protobq/load_test.go @@ -76,12 +76,12 @@ func TestUnmarshalOptions_Load(t *testing.T) { Id: 1192980459, Body: &structpb.Struct{ Fields: map[string]*structpb.Value{ - "lat": &structpb.Value{ + "lat": { Kind: &structpb.Value_NumberValue{ NumberValue: 76.16119999999999, }, }, - "lon": &structpb.Value{ + "lon": { Kind: &structpb.Value_NumberValue{ NumberValue: 14.03075, }, diff --git a/internal/examples/proto/Makefile b/internal/examples/proto/Makefile index 683668d..13f1f16 100644 --- a/internal/examples/proto/Makefile +++ b/internal/examples/proto/Makefile @@ -1,5 +1,5 @@ # Code generated by go.einride.tech/sage. DO NOT EDIT. -# To learn more, see ../../../.sage/sagefile.go and https://github.com/einride/sage. +# To learn more, see ../../../.sage/main.go and https://github.com/einride/sage. .DEFAULT_GOAL := all @@ -10,7 +10,7 @@ sagefile := $(abspath $(cwd)/../../../.sage/bin/sagefile) go := $(shell command -v go 2>/dev/null) export GOWORK ?= off ifndef go -SAGE_GO_VERSION ?= 1.18.4 +SAGE_GO_VERSION ?= 1.20.2 export GOROOT := $(abspath $(cwd)/../../../.sage/tools/go/$(SAGE_GO_VERSION)/go) export PATH := $(PATH):$(GOROOT)/bin go := $(GOROOT)/bin/go diff --git a/internal/examples/proto/einride/bigquery/public/v1/dogecoin_transaction.proto b/internal/examples/proto/einride/bigquery/public/v1/dogecoin_transaction.proto index ee74c03..c4f8f7c 100644 --- a/internal/examples/proto/einride/bigquery/public/v1/dogecoin_transaction.proto +++ b/internal/examples/proto/einride/bigquery/public/v1/dogecoin_transaction.proto @@ -42,8 +42,8 @@ message DogecoinTransaction { string type = 8; // STRING NULLABLE repeated string addresses = 9; // STRING REPEATED - // TOOD: Figure out if there's a common protobuf type for NUMERIC. - //string value = 10; // NUMERIC NULLABLE + // TOOD: Figure out if there's a common protobuf type for NUMERIC. + //string value = 10; // NUMERIC NULLABLE } message Output { @@ -54,7 +54,7 @@ message DogecoinTransaction { string type = 5; // STRING NULLABLE repeated string addresses = 6; // STRING REPEATED - // TOOD: Figure out if there's a common protobuf type for NUMERIC. - //string value = 7; // NUMERIC NULLABLE + // TOOD: Figure out if there's a common protobuf type for NUMERIC. + //string value = 7; // NUMERIC NULLABLE } }