(reason string)
| 927 | } |
| 928 | |
| 929 | func DeprecationComment(reason string) string { |
| 930 | content := "Deprecated:" // The colon is required at the end even without reason |
| 931 | if reason != "" { |
| 932 | content += fmt.Sprintf(" %s", reason) |
| 933 | } else { |
| 934 | content += " this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set" |
| 935 | } |
| 936 | |
| 937 | return stringToGoCommentWithPrefix(content, "") |
| 938 | } |
| 939 | |
| 940 | func stringToGoCommentWithPrefix(in, prefix string) string { |
| 941 | if len(in) == 0 || len(strings.TrimSpace(in)) == 0 { // ignore empty comment |
no test coverage detected