func createMovies(mqb models.MovieReaderWriter, n int, o int) error {
	const namePlain = "Name"
	const nameNoCase = "NaMe"

	for i := 0; i < n+o; i++ {
		index := i
		name := namePlain

		if i >= n { // i<n tags get normal names
			name = nameNoCase       // i>=n movies get dup names if case is not checked
			index = n + o - (i + 1) // for the name to be the same the number (index) must be the same also
		} // so count backwards to 0 as needed
		// movies [ i ] and [ n + o - i - 1  ] should have similar names with only the Name!=NaMe part different

		name = getMovieStringValue(index, name)
		movie := models.Movie{
			Name:     sql.NullString{String: name, Valid: true},
			URL:      getMovieNullStringValue(index, urlField),
			Checksum: md5.FromString(name),
		}

		created, err := mqb.Create(movie)

		if err != nil {
			return fmt.Errorf("Error creating movie [%d] %v+: %s", i, movie, err.Error())
		}

		movieIDs = append(movieIDs, created.ID)
		movieNames = append(movieNames, created.Name.String)
	}

	return nil
}
// createMoviees creates n movies with plain Name and o movies with camel cased NaMe included
createMoviees creates n movies with plain Name and o movies with camel cased NaMe included
// createMoviees creates n movies with plain Name and o movies with camel cased NaMe included
func createMovies(mqb models.MovieReaderWriter, n int, o int) error {
	const namePlain = "Name"
	const nameNoCase = "NaMe"
	for i := 0; i < n+o; i++ {
		index := i
		name := namePlain
		if i >= n { 
			name = nameNoCase       
			index = n + o - (i + 1) 
		} 
		name = getMovieStringValue(index, name)
		movie := models.Movie{
			Name:     sql.NullString{String: name, Valid: true},
			URL:      getMovieNullStringValue(index, urlField),
			Checksum: md5.FromString(name),
		}
		created, err := mqb.Create(movie)
		if err != nil {
			return fmt.Errorf("Error creating movie [%d] %v+: %s", i, movie, err.Error())
		}
		movieIDs = append(movieIDs, created.ID)
		movieNames = append(movieNames, created.Name.String)
	}
	return nil
}
func createMovies ( mqb models . MovieReaderWriter , n int , o int ) error { const namePlain = " " const nameNoCase = " " for i := 0 ; i < n + o ; i ++ { index := i name := namePlain if i >= n { name = nameNoCase index = n + o - ( i + 1 ) } name = getMovieStringValue ( index , name ) movie := models . Movie { Name : sql . NullString { String : name , Valid : true } , URL : getMovieNullStringValue ( index , urlField ) , Checksum : md5 . FromString ( name ) , } created , err := mqb . Create ( movie ) if err != nil { return fmt . Errorf ( " " , i , movie , err . Error ( ) ) } movieIDs = append ( movieIDs , created . ID ) movieNames = append ( movieNames , created . Name . String ) } return nil }
createMoviees creates n movies with plain Name and o movies with camel cased NaMe included
createMoviees creates n movies with plain Name and o movies with camel cased NaMe included
// i<n tags get normal names // i>=n movies get dup names if case is not checked // for the name to be the same the number (index) must be the same also // so count backwards to 0 as needed // movies [ i ] and [ n + o - i - 1  ] should have similar names with only the Name!=NaMe part different