code: func dominantField(fields []field) (field, bool) {
  	// The fields are sorted in increasing index-length order. The winner
  	// must therefore be one with the shortest index length. Drop all
  	// longer entries, which is easy: just truncate the slice.
  	length := len(fields[0].index)
  	tagged := -1 // Index of first tagged field.
  	for i, f := range fields {
  		if len(f.index) > length {
  			fields = fields[:i]
  			break
  		}
  		if f.tag {
  			if tagged >= 0 {
  				// Multiple tagged fields at the same level: conflict.
  				// Return no field.
  				return field{}, false
  			}
  			tagged = i
  		}
  	}
  	if tagged >= 0 {
  		return fields[tagged], true
  	}
  	// All remaining fields have the same length. If there's more than one,
  	// we have a conflict (two fields named "X" at the same level) and we
  	// return no field.
  	if len(fields) > 1 {
  		return field{}, false
  	}
  	return fields[0], true
  }
docs: // dominantField looks through the fields, all of which are known to
  // have the same name, to find the single field that dominates the
  // others using Go's embedding rules, modified by the presence of
  // JSON tags. If there are multiple top-level fields, the boolean
  // will be false: This condition is an error in Go and we skip all
  // the fields.