From 71d3b926ecc7279b01452b1522ea61b226edae35 Mon Sep 17 00:00:00 2001 From: zenix Date: Mon, 15 Aug 2022 21:46:13 +0900 Subject: [PATCH] fix: go1.7 --- pkg/strategy/drift/output.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/drift/output.go b/pkg/strategy/drift/output.go index 6bdca8e71..1043c3e1e 100644 --- a/pkg/strategy/drift/output.go +++ b/pkg/strategy/drift/output.go @@ -75,9 +75,9 @@ func (s *Strategy) ParamDump(f io.Writer, seriesLength ...int) { } } else if canString { fmt.Fprintf(f, "%s: %s\n", fieldName, stringFunc.Call(nil)[0].String()) - } else if field.CanInt() { + } else if field.CanConvert(reflect.TypeOf(int(0))) { fmt.Fprintf(f, "%s: %d\n", fieldName, field.Int()) - } else if field.CanFloat() { + } else if field.CanConvert(reflect.TypeOf(float64(0))) { fmt.Fprintf(f, "%s: %.4f\n", fieldName, field.Float()) } else if field.CanInterface() { fmt.Fprintf(f, "%s: %v", fieldName, field.Interface())