diff --git a/payload.go b/payload.go index b233e4f..69af8dc 100644 --- a/payload.go +++ b/payload.go @@ -282,6 +282,7 @@ func LoadMetadataFromFile(path string) error { var name string for i, l := range lines { + fmt.Println(l) l = strings.TrimSpace(l) if len(l) == 0 { continue @@ -327,18 +328,9 @@ func ReadFileLines(path string) ([]string, error) { defer f.Close() var s strings.Builder - for { - buf := make([]byte, 1024) - n, err := f.Read(buf) - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - - s.Write(buf[:n]) + if _, err = io.Copy(&s, f); err != nil { + return nil, err } lines := strings.Split(s.String(), "\n")