func MakeDijkstraGrid(inputGrid [][]string) *Dijkstra {
	dijkstra := Dijkstra{}
	portalMapHelper := make(map[string][2]int)
	grid := make([][]*Node, len(inputGrid)-4)
	for row := 2; row < len(inputGrid)-2; row++ {
		grid[row-2] = make([]*Node, len(inputGrid[0])-4)
		for col := 2; col < len(inputGrid[0])-2; col++ {
			switch value := inputGrid[row][col]; value {
			case "#":  
				grid[row-2][col-2] = &Node{"#", math.MaxInt32, "", [2]int{0, 0}}
			case ".":  
				hallwayNode := &Node{
					value:           ".",
					distance:        math.MaxInt32,
					portalName:      "",
					jumpCoordinates: [2]int{0, 0},
				}
				portalName := getPortalName(inputGrid, row, col)
				if len(portalName) != 0 {
					hallwayNode.portalName = portalName
					if pairedPortal := portalMapHelper[portalName]; pairedPortal == [2]int{0, 0} {
						portalMapHelper[portalName] = [2]int{row - 2, col - 2}
					} else {
						hallwayNode.jumpCoordinates = pairedPortal
						grid[pairedPortal[0]][pairedPortal[1]].jumpCoordinates = [2]int{row - 2, col - 2}
					}
				}
				grid[row-2][col-2] = hallwayNode
				if portalName == "AA" {
					dijkstra.startCoordinates = [2]int{row - 2, col - 2}
					hallwayNode.distance = 0
					dijkstra.queue = [][2]int{
						[2]int{row - 2, col - 2},
					}
				}
				if portalName == "ZZ" {
					dijkstra.finishCoordinates = [2]int{row - 2, col - 2}
				}
			}
		}
	}
	dijkstra.grid = grid
	return &dijkstra
}
MakeDijkstraGrid does just that
package main
import (
	"fmt"
	"math"
	"strings"
	"github.com/alexchao26/advent-of-code-go/util"
)
func main() {
	input := util.ReadFile("../input.txt")
	lines := strings.Split(string(input), "\n")
	grid := make([][]string, len(lines))
	for i, v := range lines {
		grid[i] = strings.Split(v, "")
	}
	dijkstra := MakeDijkstraGrid(grid)
	for !dijkstra.handleFrontOfQueue() {
	}
	fmt.Println("Distance to ZZ portal", dijkstra.grid[dijkstra.finishCoordinates[0]][dijkstra.finishCoordinates[1]].distance)
}
type Dijkstra struct {
	grid              [][]*Node
	queue             [][2]int
	portalMap         map[string][2]int  
	startCoordinates  [2]int
	finishCoordinates [2]int
}
type Node struct {
	value           string
	distance        int
	portalName      string  
	jumpCoordinates [2]int  
}