From 8d3d784adf55237eb47cde115ca3ff690267f270 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Wed, 1 Mar 2023 00:39:19 -0500 Subject: [PATCH] fix build error --- internal/pkg/parsing/lexer/lexer.go | 4 ++-- tools/build-dsl | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/pkg/parsing/lexer/lexer.go b/internal/pkg/parsing/lexer/lexer.go index db7735e43..e2ead0fc2 100644 --- a/internal/pkg/parsing/lexer/lexer.go +++ b/internal/pkg/parsing/lexer/lexer.go @@ -3,7 +3,7 @@ package lexer import ( - "os" + "io/ioutil" "unicode/utf8" "github.com/johnkerl/miller/internal/pkg/parsing/token" @@ -45,7 +45,7 @@ func (s *SourceContext) Source() string { } func NewLexerFile(fpath string) (*Lexer, error) { - src, err := os.ReadFile(fpath) + src, err := ioutil.ReadFile(fpath) if err != nil { return nil, err } diff --git a/tools/build-dsl b/tools/build-dsl index eacbffc68..c31f0ba52 100755 --- a/tools/build-dsl +++ b/tools/build-dsl @@ -52,4 +52,8 @@ fi # Override GOCC codegen with customized error handling cp internal/pkg/parsing/errors.go.template internal/pkg/parsing/errors/errors.go +# We might need a manual replace of os.ReadFile by ioutil.ReadFile in autogen code. Note we don't +# use latest-and-greatest Go compiler version in our go.mod since we want to build on Centos which +# can be trailing-edge in that regard. + for x in internal/pkg/parsing/*/*.go; do gofmt -w $x; done