func dealIntoNewStack(deck []int) []int {
	for i := 0; i < len(deck)/2; i++ {
		deck[i], deck[len(deck)-1-i] = deck[len(deck)-1-i], deck[i]
	}
	return deck
}
side effects to handle "deal into new stack" command
package main
import (
	"fmt"
	"strconv"
	"strings"
	"github.com/alexchao26/advent-of-code-go/util"
)
type instruction struct {
	name   string  
	number int     
}
func main() {
	input := util.ReadFile("../input.txt")
	lines := strings.Split(input, "\n")
	instructions := make([]instruction, len(lines))
	for i, line := range lines {
		splitLine := strings.Split(line, " ")
		if splitLine[len(splitLine)-1] == "stack" {
			instructions[i] = instruction{name: "deal into new stack"}
		} else {
			name := strings.Join(splitLine[0:len(splitLine)-1], " ")
			num, _ := strconv.Atoi(splitLine[len(splitLine)-1])
			instructions[i] = instruction{
				name,
				num,
			}
		}
	}
	deck := make([]int, 10007)
	for i := range deck {
		deck[i] = i
	}
	for _, inst := range instructions {
		switch inst.name {
		case "deal into new stack":
			deck = dealIntoNewStack(deck)
		case "deal with increment":
			deck = dealWithIncrement(deck, inst.number)
		case "cut":
			deck = cut(deck, inst.number)
		}
	}
	for i, v := range deck {
		if v == 2019 {
			fmt.Println("position of card 2019 is", i)
		}
	}
}