io.vrap.codegen.languages.go.GoExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of go Show documentation
Show all versions of go Show documentation
RAML API client code generators based on the REST Modeling Framework. https://github.com/vrapio/rest-modeling-framework
The newest version!
package io.vrap.codegen.languages.go
import io.vrap.rmf.codegen.types.*
import io.vrap.rmf.raml.model.types.*
import io.vrap.rmf.raml.model.types.DescriptionFacet
import java.util.*
fun DescriptionFacet.toBlockComment(): String {
val description = this.description
return if (description?.value.isNullOrBlank()) {
""
} else description.value
.lines()
.joinToString(prefix = "/**\n*\t", postfix = "\n*/", separator = "\n*\t")
}
fun DescriptionFacet.toLineComment(): String {
val description = this.description
return if (description?.value.isNullOrBlank()) {
""
} else description.value
.lines()
.joinToString(separator = "\n")
.trimMargin()
.prependIndent("// ")
}