Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/codegen/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ func GenerateUnionAndAdditionalProopertiesBoilerplate(t *template.Template, type
func SanitizeCode(goCode string) string {
// remove any byte-order-marks which break Go-Code
// See: https://groups.google.com/forum/#!topic/golang-nuts/OToNIPdfkks
return strings.Replace(goCode, "\uFEFF", "", -1)
return strings.ReplaceAll(goCode, "\uFEFF", "")
}

// GetUserTemplateText attempts to retrieve the template text from a passed in URL or file
Expand Down
4 changes: 2 additions & 2 deletions pkg/codegen/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ func stringToGoCommentWithPrefix(in, prefix string) string {
}

// Normalize newlines from Windows/Mac to Linux
in = strings.Replace(in, "\r\n", "\n", -1)
in = strings.Replace(in, "\r", "\n", -1)
in = strings.ReplaceAll(in, "\r\n", "\n")
in = strings.ReplaceAll(in, "\r", "\n")

// Add comment to each line
var lines []string
Expand Down