fix: docsgen: revert rename of API Name to Num

This commit is contained in:
Aayush
2022-09-14 12:41:47 -04:00
parent bdb62e6a40
commit e3e6ff67db
3 changed files with 168 additions and 168 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ func run() error {
package config
type DocField struct {
Num string
Name string
Type string
Comment string
}
@@ -109,7 +109,7 @@ var Doc = map[string][]DocField{
for _, f := range typ {
fmt.Println("\t\t{")
fmt.Printf("\t\t\tNum: \"%s\",\n", f.Name)
fmt.Printf("\t\t\tName: \"%s\",\n", f.Name)
fmt.Printf("\t\t\tType: \"%s\",\n\n", f.Type)
fmt.Printf("\t\t\tComment: `%s`,\n", f.Comment)
fmt.Println("\t\t},")
+163 -163
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -16,7 +16,7 @@ func findDoc(root interface{}, section, name string) *DocField {
return findDocSect("Common", section, name)
}
func findDocSect(root, section, num string) *DocField {
func findDocSect(root, section, name string) *DocField {
path := strings.Split(section, ".")
docSection := Doc[root]
@@ -26,7 +26,7 @@ func findDocSect(root, section, num string) *DocField {
}
for _, field := range docSection {
if field.Num == e {
if field.Name == e {
docSection = Doc[field.Type]
break
}
@@ -35,7 +35,7 @@ func findDocSect(root, section, num string) *DocField {
}
for _, df := range docSection {
if df.Num == num {
if df.Name == name {
return &df
}
}