INNER CODE UNIT · Go

isCheckNameType

deckhouse/deckhouse · dhctl/hack/gen_preflight_checks/main.go:97

func isCheckNameType(expr ast.Expr) bool {
	switch v := expr.(type) {
	case *ast.Ident:
		return v.Name == "CheckName"
	case *ast.SelectorExpr:
		return v.Sel.Name == "CheckName"
	}
	return false
}

func stringLiteral(values []ast.Expr, idx int) string {
	if idx >= len(values) {
		return ""
	}
	lit, ok := values[idx].(*ast.BasicLit)
	if !ok || lit.Kind != token.STRING {
		return ""
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…