fix: docsgen: revert rename of API Name to Num
This commit is contained in:
parent
bdb62e6a40
commit
e3e6ff67db
@ -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},")
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user