1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-14 02:33:03 +02:00

style:change (#2022)

This commit is contained in:
songzhibin97 2022-05-22 10:00:58 +08:00 committed by GitHub
parent ec2e3ab24e
commit aa6529fb2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -38,8 +38,8 @@ func run(cmd *cobra.Command, args []string) {
if version == "dev" {
info := api.GetCommitsInfo()
fmt.Print(ParseCommitsInfo(info))
} else {
info := api.GetReleaseInfo(version)
fmt.Print(ParseReleaseInfo(info))
return
}
info := api.GetReleaseInfo(version)
fmt.Print(ParseReleaseInfo(info))
}

View File

@ -157,11 +157,12 @@ func ParseCommitsInfo(info []CommitInfo) string {
case "other":
text = "### Others\n"
}
if len(value) > 0 {
md[key] += text
for _, value := range value {
md[key] += fmt.Sprintf("- %s\n", value)
}
if len(value) == 0 {
continue
}
md[key] += text
for _, value := range value {
md[key] += fmt.Sprintf("- %s\n", value)
}
}
return fmt.Sprint(md["break"], md["deps"], md["feat"], md["fix"], md["chore"], md["other"])