Created
April 18, 2015 10:11
-
-
Save bolilla/6499a3b99098354ebedc to your computer and use it in GitHub Desktop.
GoPadawan Err MethodIntArr
This file contains 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 (x [3]int) elDoble() [3]int { | |
for i, _ := range x { | |
x[i] = x[i] * 2 | |
} | |
return x | |
} | |
func main() { | |
var miArray [3]int = [3]int{1, 2, 3} | |
fmt.Println("miArray", miArray) | |
fmt.Println("y el doble es", miArray.elDoble()) | |
fmt.Println("la variable sigue siendo", miArray) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment