From de90b592fb46daba71c9e36112edbbe17e5f4564 Mon Sep 17 00:00:00 2001 From: Jonathan Gold Date: Mon, 3 Dec 2018 08:02:28 -0500 Subject: [PATCH] lang: Fix error message format strings This commit replaces %s with %d in two error messages, where the argument is an integer, not a string. --- lang/structs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/structs.go b/lang/structs.go index d911e435..baa948ca 100644 --- a/lang/structs.go +++ b/lang/structs.go @@ -2637,7 +2637,7 @@ func (obj *ExprStruct) Type() (*types.Type, error) { // vals t, e := x.Value.Type() if e != nil { - err = errwrap.Wrapf(e, "field val, index `%s` did not return a type", i) + err = errwrap.Wrapf(e, "field val, index `%d` did not return a type", i) break } if _, exists := m[x.Name]; exists { @@ -2782,7 +2782,7 @@ func (obj *ExprStruct) Value() (types.Value, error) { // vals t, err := x.Value.Type() if err != nil { - return nil, errwrap.Wrapf(err, "field val, index `%s` did not return a type", i) + return nil, errwrap.Wrapf(err, "field val, index `%d` did not return a type", i) } if _, exists := typ.Map[x.Name]; exists { return nil, fmt.Errorf("struct type field index `%d` already exists", i)