From c6e6220fef7d51fff57b3c4846cf28fc3ae8c668 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 5 Feb 2020 08:56:59 -0800 Subject: [PATCH] template: replace deprecated os.SEEK_SET with io.SeekStart --- template/parse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/parse.go b/template/parse.go index ff5c60988..33de19c22 100644 --- a/template/parse.go +++ b/template/parse.go @@ -408,7 +408,7 @@ func ParseFile(path string) (*Template, error) { defer os.Remove(f.Name()) defer f.Close() io.Copy(f, os.Stdin) - f.Seek(0, os.SEEK_SET) + f.Seek(0, io.SeekStart) } else { f, err = os.Open(path) if err != nil { @@ -423,7 +423,7 @@ func ParseFile(path string) (*Template, error) { return nil, err } // Rewind the file and get a better error - f.Seek(0, os.SEEK_SET) + f.Seek(0, io.SeekStart) // Grab the error location, and return a string to point to offending syntax error line, col, highlight := highlightPosition(f, syntaxErr.Offset) err = fmt.Errorf("Error parsing JSON: %s\nAt line %d, column %d (offset %d):\n%s", err, line, col, syntaxErr.Offset, highlight)