go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.41k stars 1.31k forks source link

Use strings.ReplaceAll(...) instead of strings.Replace(..., -1) #1104

Closed alexandear closed 11 months ago

alexandear commented 1 year ago

Fixes Or Enhances

Make sure that you've checked the boxes below before you submit PR:

@go-playground/validator-maintainers

coveralls commented 1 year ago

Coverage Status

Coverage: 73.88%. Remained the same when pulling c03041345e32eca120caf1452e904fa5411dd0db on alexandear:refactor-replaceall into c8b98cbcea08971fbead222ddf5fd406a40d40ed on go-playground:master.

alexandear commented 1 year ago

Yes, ReplaceAll it's just an alias. This function was added in Go 1.12 "in the spirit of keeping Go simple". The proposal is here https://github.com/golang/go/issues/27864.