func (comp *Intcode) Step(input int) {
	for comp.IsRunning {
		opcode, paramIndexes := comp.GetOpCodeAndParamIndexes()
		param1, param2, param3 := paramIndexes[0], paramIndexes[1], paramIndexes[2]
		switch opcode {
		case 1, 2, 7, 8:
			comp.ResizeMemory(param1, param2, param3)
		case 5, 6:
			comp.ResizeMemory(param1, param2)
		case 3, 4, 9:
			comp.ResizeMemory(param1)
		}
		switch opcode {
		case 99:  
			comp.IsRunning = false
		case 1:  
			comp.PuzzleInput[param3] = comp.PuzzleInput[param1] + comp.PuzzleInput[param2]
			comp.InstructionIndex += 4
		case 2:  
			comp.PuzzleInput[param3] = comp.PuzzleInput[param1] * comp.PuzzleInput[param2]
			comp.InstructionIndex += 4
		case 3:  
			if input == -1 {
				return
			}
			comp.PuzzleInput[param1] = input
			comp.InstructionIndex += 2
			input = -1
		case 4:  
			output := comp.PuzzleInput[param1]
			comp.Outputs = append(comp.Outputs, output)
			fmt.Print(cast.ASCIIIntToChar(output))
			comp.InstructionIndex += 2
		case 5:
			if comp.PuzzleInput[param1] != 0 {
				comp.InstructionIndex = comp.PuzzleInput[param2]
			} else {
				comp.InstructionIndex += 3
			}
		case 6:
			if comp.PuzzleInput[param1] == 0 {
				comp.InstructionIndex = comp.PuzzleInput[param2]
			} else {
				comp.InstructionIndex += 3
			}
		case 7:
			if comp.PuzzleInput[param1] < comp.PuzzleInput[param2] {
				comp.PuzzleInput[param3] = 1
			} else {
				comp.PuzzleInput[param3] = 0
			}
			comp.InstructionIndex += 4
		case 8:
			if comp.PuzzleInput[param1] == comp.PuzzleInput[param2] {
				comp.PuzzleInput[param3] = 1
			} else {
				comp.PuzzleInput[param3] = 0
			}
			comp.InstructionIndex += 4
		case 9:
			comp.RelativeBase += comp.PuzzleInput[param1]
			comp.InstructionIndex += 2
		default:
			log.Fatalf("Error: unknown opcode %v at index %v", opcode, comp.PuzzleInput[comp.InstructionIndex])
		}
	}
}
Step will read the next 4 values in the input `sli` and make updates
according to the opcodes
Update to run iteratively (while the computer is running)
it will also return out if a -1 input is asked for
then call Step again to provide the next input, or run with -1 from the start
to run the computer until it asks for an input OR terminates
package main
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
	"github.com/alexchao26/advent-of-code-go/cast"
	"github.com/alexchao26/advent-of-code-go/util"
)
func main() {
	inputFile := util.ReadFile("../input.txt")
	splitStrings := strings.Split(inputFile, ",")
	inputNumbers := make([]int, len(splitStrings))
	for i, v := range splitStrings {
		inputNumbers[i], _ = strconv.Atoi(v)
	}
	comp := MakeComputer(inputNumbers)
	comp.Step(-1)
	for comp.IsRunning {
		text := readFromCommandLine()
		instruction := convertStringToASCII(text)
		for _, v := range instruction {
			comp.Step(v)
		}
	}
}
func readFromCommandLine() string {
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	return text
}
func convertStringToASCII(input string) []int {
	result := make([]int, len(input))
	for i, v := range input {
		result[i] = int(v)
	}
	return result
}
type Intcode struct {
	PuzzleInput      []int  
	InstructionIndex int    
	RelativeBase     int    
	Outputs          []int  
	IsRunning        bool   
}
func MakeComputer(PuzzleInput []int) *Intcode {
	puzzleInputCopy := make([]int, len(PuzzleInput))
	copy(puzzleInputCopy, PuzzleInput)
	comp := Intcode{
		puzzleInputCopy,
		0,
		0,
		make([]int, 0),
		true,
	}
	return &comp
}