• Daniel Martí's avatar
    cmd/vet: check embedded field tags too · 4b439e41
    Daniel Martí authored
    We can no longer use the field's position for the duplicate field tag
    warning - since we now check embedded tags, the positions may belong to
    copmletely different packages.
    
    Instead, keep track of the lowest field that's still part of the
    top-level struct type that we are checking.
    
    Finally, be careful to not repeat the independent struct field warnings
    when checking fields again because they are embedded into another
    struct. To do this, separate the duplicate tag value logic into a func
    that recurses into embedded fields on a per-encoding basis.
    
    Fixes #25593.
    
    Change-Id: I3bd6e01306d8ec63c0314d25e3136d5e067a9517
    Reviewed-on: https://go-review.googlesource.com/115677
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
    4b439e41
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...