From a6c92e33b7b19c3195426193b581e1695d84e291 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 23 Sep 2022 22:38:36 -0700 Subject: [PATCH] Use Go 1.19 (#23) Signed-off-by: Tamal Saha --- .github/workflows/ci.yml | 2 +- Makefile | 2 +- schema_validator/doc.go | 3 +-- server/server.go | 4 ++-- testing/testproto/test.pb.go | 2 ++ 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f57919e..1ee69f13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.18 + go-version: ^1.19 id: go - name: Check out code into the Go module directory diff --git a/Makefile b/Makefile index e2af29dd..b7ee6b37 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) BASEIMAGE_PROD ?= gcr.io/distroless/static-debian11 BASEIMAGE_DBG ?= debian:bullseye -GO_VERSION ?= 1.18 +GO_VERSION ?= 1.19 BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) diff --git a/schema_validator/doc.go b/schema_validator/doc.go index 6eb16de9..62c9d267 100644 --- a/schema_validator/doc.go +++ b/schema_validator/doc.go @@ -4,7 +4,7 @@ /* `grpc_validator` a generic request contents schema_validator server-side middleware for gRPC. -Request Validator Middleware +# Request Validator Middleware Validating input is important, and hard. It also causes a lot of boiler plate. This middleware checks for the existance of a `Validate` method on each of the messages of a gRPC request. This @@ -16,7 +16,6 @@ While it is generic, it was indented to be used with https://github.com/mwitkow/ a Go protocol buffers codegen plugin that creates the `Validate` methods (including nested messages) based on declarative options in the `.proto` files themselves. For example: - syntax = "proto3"; package schema_validator.examples; import "github.com/mwitkow/go-proto-validators/schema_validator.proto"; diff --git a/server/server.go b/server/server.go index 7da4d171..52e98bad 100644 --- a/server/server.go +++ b/server/server.go @@ -19,9 +19,9 @@ package server import ( "crypto/tls" "crypto/x509" - "io/ioutil" "net" "net/http" + "os" "strings" "time" @@ -149,7 +149,7 @@ func (s *Server) ServeHTTPS() { NextProtos: []string{"h2", "http/1.1"}, } if s.CACertFile != "" { - caCert, err := ioutil.ReadFile(s.CACertFile) + caCert, err := os.ReadFile(s.CACertFile) if err != nil { klog.Fatal(err) } diff --git a/testing/testproto/test.pb.go b/testing/testproto/test.pb.go index dd238068..4a8993f9 100644 --- a/testing/testproto/test.pb.go +++ b/testing/testproto/test.pb.go @@ -5,9 +5,11 @@ Package mwitkow_testproto is a generated protocol buffer package. It is generated from these files: + test.proto It has these top-level messages: + Empty PingRequest PingResponse