Function relocation.

This commit is contained in:
go-jet 2019-07-20 17:44:43 +02:00
parent de34095ece
commit 1ae76d5efd
7 changed files with 15 additions and 10 deletions

View file

@ -6,6 +6,7 @@ import (
"go/format"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"text/template"
@ -154,3 +155,7 @@ func FormatTimestamp(t time.Time) []byte {
}
return b
}
func IsNil(v interface{}) bool {
return v == nil || (reflect.ValueOf(v).Kind() == reflect.Ptr && reflect.ValueOf(v).IsNil())
}