mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-01 13:17:21 +02:00
Fixed bug in generator
Fixed bug for acmedns module auto generation for ovh provider #161
This commit is contained in:
parent
a3e16594e8
commit
08d52024ab
@ -132,6 +132,23 @@ func extractConfigStruct(sourceCode string) (string, string) {
|
||||
// Extract the struct name and its content.
|
||||
structName := match[1]
|
||||
structContent := match[2]
|
||||
if structName != "Config" {
|
||||
allStructs := structRegex.FindAllStringSubmatch(sourceCode, 10)
|
||||
for _, thisStruct := range allStructs {
|
||||
//fmt.Println("Name => ", test[1])
|
||||
//fmt.Println("Content => ", test[2])
|
||||
|
||||
if thisStruct[1] == "Config" {
|
||||
structName = "Config"
|
||||
structContent = thisStruct[2]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if structName != "Config" {
|
||||
panic("Unable to find Config for this provider")
|
||||
}
|
||||
}
|
||||
|
||||
return structName, structContent
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user