Created
July 2, 2018 15:23
-
-
Save jjuliano/e68a2fb782f1daf7bd4e4ccfc5800a7d 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
package main | |
import "fmt" | |
func main() { | |
var oldArray [2]string | |
var newArray [2]string | |
oldArray[0] = "foo" | |
newArray = oldArray | |
newArray[1] = "baz" | |
oldArray[1] = "bar" | |
fmt.Println(oldArray) // [foo bar] | |
fmt.Println(newArray) // [foo baz] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment