Merge pull request #832 from gtardif/fix_aci_etchosts

Add trailing empty line in /etc/hosts
This commit is contained in:
Guillaume Tardif 2020-10-27 09:50:04 +01:00 committed by GitHub
commit 367753303d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -33,6 +33,10 @@ func SetHostNames(file string, hosts ...string) error {
fmt.Println("Setting local hosts for " + strings.Join(hosts, ", "))
for _, host := range hosts {
_, err = f.WriteString("\n127.0.0.1 " + host)
if err != nil {
return err
}
}
_, err = f.WriteString("\n")
return err
}

View File

@ -1,4 +1,4 @@
127.0.0.1 foo
127.0.0.1 bar
127.0.0.1 zot
127.0.0.1 zot