user/group.go
func parseGroup(row string) (*Group, error) {
	fields := strings.Split(row, ":")
	if len(fields) != 4 {
		return nil, rowError{_GROUP_FILE, row}
	}

	gid, err := strconv.Atoi(fields[2])
	if err != nil {
		return nil, atoiError{_GROUP_FILE, row, "GID"}
	}

	return &Group{
		Name:     fields[0],
		password: fields[1],
		GID:      gid,
		UserList: strings.Split(fields[3], ","),
	}, nil
}
func parseGroup(row string) (*Group, error) {
	fields := strings.Split(row, ":")
	if len(fields) != 4 {
		return nil, rowError{_GROUP_FILE, row}
	}

	gid, err := strconv.Atoi(fields[2])
	if err != nil {
		return nil, atoiError{_GROUP_FILE, row, "GID"}
	}

	return &Group{
		Name:     fields[0],
		password: fields[1],
		GID:      gid,
		UserList: strings.Split(fields[3], ","),
	}, nil
}
func parseGroup ( row string ) ( * Group , error ) { fields := strings . Split ( row , " " ) if len ( fields ) != 4 { return nil , rowError { _GROUP_FILE , row } } gid , err := strconv . Atoi ( fields [ 2 ] ) if err != nil { return nil , atoiError { _GROUP_FILE , row , " " } } return & Group { Name : fields [ 0 ] , password : fields [ 1 ] , GID : gid , UserList : strings . Split ( fields [ 3 ] , " " ) , } , nil }
// parseGroup parses the row of a group.
parseGroup parses the row of a group .