Advertisement
cwchen

[Go] Simulating a matrix with a multi-dimensional slice.

Sep 20th, 2017
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.19 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "log"
  5. )
  6.  
  7. func main() {
  8.     matrix := [][]float64{
  9.         []float64{1, 2, 3},
  10.         []float64{4, 5, 6},
  11.     }
  12.  
  13.     if !(matrix[1][1] == 5) {
  14.         log.Fatal("Wrong value")
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement