MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / DeprecationComment

Function DeprecationComment

pkg/codegen/utils.go:929–938  ·  view source on GitHub ↗
(reason string)

Source from the content-addressed store, hash-verified

927}
928
929func 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
940func stringToGoCommentWithPrefix(in, prefix string) string {
941 if len(in) == 0 || len(strings.TrimSpace(in)) == 0 { // ignore empty comment

Callers 1

GenFieldsFromPropertiesFunction · 0.85

Calls 1

Tested by

no test coverage detected