line 150: result := MakeMatrix(make([]float64, A.cols*A.rows), A.cols, A.rows) maybe change to: result := MakeMatrix(make([]float64, A.cols*A.rows), A.rows, .cols) the order of the params in not right ??? :)