tools: update implements tool to new deprecated/preview style

Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
Sven Anderson 2021-10-01 17:34:38 +09:00 committed by mergify[bot]
parent ac4494e707
commit cee047149f

View File

@ -85,11 +85,11 @@ func readDocComment(fdec *ast.FuncDecl, gfunc *goFunction) {
gfunc.comment = fdec.Doc.Text()
lines := strings.Split(gfunc.comment, "\n")
for i := range lines {
if strings.Contains(lines[i], "DEPRECATED") {
if strings.HasPrefix(lines[i], "Deprecated: ") {
gfunc.isDeprecated = true
logger.Printf("marked deprecated: %s\n", fdec.Name.Name)
}
if strings.Contains(lines[i], "PREVIEW") {
if strings.HasPrefix(lines[i], " PREVIEW") {
gfunc.isPreview = true
logger.Printf("marked preview: %s\n", fdec.Name.Name)
}