From 7b83690fac68bac550498ea0c71932dcefeb8d94 Mon Sep 17 00:00:00 2001 From: klauspost Date: Wed, 25 Feb 2015 16:41:43 +0100 Subject: [PATCH] Add an example of a warning we would like to have printed. --- inception/reflect.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inception/reflect.go b/inception/reflect.go index fb81036..3979ee8 100644 --- a/inception/reflect.go +++ b/inception/reflect.go @@ -23,6 +23,7 @@ import ( "bytes" "encoding/json" + "log" "reflect" "unicode/utf8" ) @@ -272,6 +273,7 @@ func dominantField(fields []*StructField) (*StructField, bool) { if tagged >= 0 { // Multiple tagged fields at the same level: conflict. // Return no field. + log.Printf("Warning: Duplicate tagged entry with entry %s found. Ignoring entries.", f.JsonName, f.Typ) return nil, false } tagged = i