removed unnecessary byte slice conversions

This commit is contained in:
grumbulon 2023-02-04 23:17:08 -05:00 committed by Gitea
parent cf1071b389
commit 25229f9c81

View file

@ -17,7 +17,7 @@ func makeLocal(zone *ZoneRequest) error {
return fmt.Errorf("file %s already exists: %w", zone.FileName, err)
}
if len([]byte(zone.Body)) == 0 {
if len(zone.Body) == 0 {
return errEmptyFile
}
@ -47,7 +47,7 @@ func makeLocal(zone *ZoneRequest) error {
}
}()
err = os.WriteFile(f.Name(), []byte(zone.Body), 0o600)
err = os.WriteFile(f.Name(), zone.Body, 0o600)
if err != nil {
return fmt.Errorf("failed to write file locally: %w", err)