Created
February 28, 2018 16:33
-
-
Save dav1x/f0432e565a23e6a388dd2abbcb017aea 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
Question 6: | |
Take a look at the following snippet of code. | |
package main | |
import "fmt" | |
type location struct { | |
longitude float64 | |
latitude float64 | |
} | |
func main() { | |
newYork := location{ | |
latitude: 40.73, | |
longitude: -73.93, | |
} | |
newYork.changeLatitude() | |
fmt.Println(newYork) | |
} | |
func (lo *location) changeLatitude() { | |
(*lo).latitude = 41.0 | |
} | |
In the 'changeLatitude' function, what is *location in the receiver list (after the word 'func') communicating to us? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment