// Parse /etc/passwd files and serialize them
-// Copyright (C) 2019 Simon Ruderich
+// Copyright (C) 2019-2021 Simon Ruderich
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
t, err := s.ReadString('\n')
if err != nil {
if err == io.EOF {
+ if t != "" {
+ return nil, fmt.Errorf(
+ "no newline in last line: %q",
+ t)
+ }
break
}
return nil, err