pki/vendor/github.com/go-acme/lego/v4/challenge/dns01/fqdn.go
Paul Lecuq a7d4f06285
All checks were successful
continuous-integration/drone/push Build is passing
ready for public beta
2020-11-25 20:36:07 +01:00

20 lines
391 B
Go

package dns01
// ToFqdn converts the name into a fqdn appending a trailing dot.
func ToFqdn(name string) string {
n := len(name)
if n == 0 || name[n-1] == '.' {
return name
}
return name + "."
}
// UnFqdn converts the fqdn into a name removing the trailing dot.
func UnFqdn(name string) string {
n := len(name)
if n != 0 && name[n-1] == '.' {
return name[:n-1]
}
return name
}