Created
June 2, 2019 22:05
-
-
Save jjuliano/80c97fc9627b4e4f48130f6640a9096c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var collect [4]int | |
integers := [4]int{1, 2, 3, 4} | |
for i := 0; i < len(integers); i++ { | |
collect[i] = integers[i] * integers[i] | |
if i == len(integers) - 1 { | |
fmt.Println(collect) | |
} | |
} | |
// [1 4 9 16] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment