Skip to content

Commit

Permalink
[ignore] Renamed generate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
samiib authored and lhercot committed Nov 11, 2024
1 parent 4fe22cb commit 079f3e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ func getExampleCode(filePath string) []byte {
}

// When RE_GEN_CLASSES environment variable is set, the existing class metadata is retrieved from APIC or the latest devnet docs and stored in the meta directory.
func reGenClassMetadata() {
func reGenerateClassMetadata() {
reGenClasses, err := strconv.ParseBool(os.Getenv("RE_GEN_CLASSES"))
if err != nil {
return
Expand All @@ -790,7 +790,6 @@ func reGenClassMetadata() {

// When GEN_CLASSES environment variable is set, the class metadata is retrieved from the APIC or the latest devnet docs and stored in the meta directory.
func getClassMetadata(classNames string) {

if classNames != "" {
var name, nameSpace, url string
classNameList := strings.Split(classNames, ",")
Expand Down Expand Up @@ -834,7 +833,7 @@ func getClassMetadata(classNames string) {
}

// When GEN_ANNOTATION_UNSUPPORTED environment variable is set, the list of classes that don't support annotation are retrieved and annotation_unsupported.go is generated.
func genAnnotationUnsupported() []string {
func generateAnnotationUnsupported() []string {
classes := []string{}
genAnnotationUnsupported, err := strconv.ParseBool(os.Getenv("GEN_ANNOTATION_UNSUPPORTED"))
if err != nil {
Expand Down Expand Up @@ -876,13 +875,13 @@ func genAnnotationUnsupported() []string {
}

func main() {
reGenClassMetadata()
reGenerateClassMetadata()
getClassMetadata(os.Getenv("GEN_CLASSES"))
cleanDirectories()

definitions := getDefinitions()
classModels := getClassModels(definitions)
annotationUnsupported := genAnnotationUnsupported()
annotationUnsupported := generateAnnotationUnsupported()

renderTemplate("provider.go.tmpl", "provider.go", providerPath, classModels)
renderTemplate("index.md.tmpl", "index.md", docsPath, ProviderModel{Example: string(getExampleCode(providerExamplePath))})
Expand Down

0 comments on commit 079f3e4

Please sign in to comment.