cmd/vet: move jsontags into vet (#17777)

The cmd/jsontags is non-idiomatic since it is not a main binary.
Move it to a vet directory, which will eventually contain a vettool binary.

Update tailscale/corp#791

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
pull/17778/head
Joe Tsai 4 weeks ago committed by GitHub
parent 77123a569b
commit 446752687c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -28,9 +28,9 @@ var jsontagsAllowlist map[ReportKind]set.Set[string]
//
// The struct type name may be "*" for anonymous struct types such
// as those declared within a function or as a type literal in a variable.
func ParseAllowlist(b []byte) map[ReportKind]set.Set[string] {
func ParseAllowlist(s string) map[ReportKind]set.Set[string] {
var allowlist map[ReportKind]set.Set[string]
for line := range strings.SplitSeq(string(b), "\n") {
for line := range strings.SplitSeq(s, "\n") {
kind, field, _ := strings.Cut(strings.TrimSpace(line), "\t")
if allowlist == nil {
allowlist = make(map[ReportKind]set.Set[string])
Loading…
Cancel
Save