misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2024-09-22 13:23:30 +02:00
commit 5652d15426
6 changed files with 177 additions and 14 deletions

View file

@ -103,9 +103,7 @@ func (mod *ZeroGod) startAdvertiser(fileName string) error {
if err != nil {
return fmt.Errorf("could not get hostname: %v", err)
}
if !strings.HasSuffix(hostName, ".") {
hostName += "."
}
hostName = strings.ReplaceAll(hostName, ".local", "")
data, err := ioutil.ReadFile(fileName)
if err != nil {