# favadi/protoc-go-inject-tag

Inject custom tags to protobuf golang struct

Repository: https://github.com/favadi/protoc-go-inject-tag
Canonical: https://ross.abutalabs.com/products/protoc-go-inject-tag
Language: Go
License: BSD-2-Clause
License Family: permissive
Last push: 2025-11-14T09:09:54+00:00

## Health v2 (maintenance only)
Score: 46/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 52, release rhythm 8, longevity 100
- inputs: {"age_days": 3801, "days_push": 292, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1266, forks 161 (observed 2026-08-28T04:04:11.231488+00:00)

## What it is
A Go CLI tool that injects custom struct tags into generated Go protobuf (.pb.go) files using @gotags comments in .proto files. It works as a post-processing step after protoc code generation, commonly used for validation and JSON field control.

## Use cases
- inject custom struct tags into generated protobuf Go code
- add validation tags to protobuf-generated structs
- control JSON serialization of protobuf messages in Go
- post-process .pb.go files after protoc generation
- remove tag comments for OpenAPI/Swagger generation compatibility

## When to choose
- you use protoc-gen-go and need struct tags it doesn't support natively
- you want validation or JSON tags on protobuf-generated Go structs
- you need a simple post-generation step in your build pipeline

## When to avoid
- you use protoc plugins that support custom tags natively
- you don't generate Go code from protobuf
- you want tags injected at protoc plugin stage rather than post-processing

## Facets
- artifact type: cli-tool
- maturity: stable
- function: developer-tools, serialization
- domain: developer-tools, backend, apis
- platform: cli, go, cross-platform
- tags: protobuf, struct-tags, code-generation, golang, protoc

## Member repositories
- favadi/protoc-go-inject-tag (main) score 46

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:11.231488+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:03:47.093801+00:00, confidence not recorded.
  - readme: https://github.com/favadi/protoc-go-inject-tag (fetched 2026-08-28T04:04:11.231488+00:00, sha a861a3c24599)
- Data as of 2026-08-30T08:39:29.467469+00:00.
