mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
fix(goctl): restore API summaries in swagger generation (#5237)
This commit is contained in:
@@ -24,10 +24,15 @@ func getFirstUsableString(def ...string) string {
|
||||
}
|
||||
|
||||
for _, val := range def {
|
||||
str, err := strconv.Unquote(val)
|
||||
if err == nil && len(str) != 0 {
|
||||
// Try to unquote if it's a quoted string
|
||||
if str, err := strconv.Unquote(val); err == nil && len(str) != 0 {
|
||||
return str
|
||||
}
|
||||
|
||||
// Otherwise, use the value as-is if it's not empty
|
||||
if len(val) != 0 {
|
||||
return val
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user