`apt-cache policy` can also show the pinning priorities for all available versions and sources of a given package. ``` $ apt-cache policy limnoria limnoria: Installed: 2021.06.15-1 Candidate: 2021.06.15-1 Version table: 2021.07.21-1~bpo11+1 100 100 https://deb.debian.org/debian bullseye-backports/main amd64 Packages *** 2021.06.15-1 990 990 https://deb.debian.org/debian bullseye/main amd64 Packages 100 /var/lib/dpkg/status ``` --- ## Go Methods and pointer indirection functions with a pointer argument must take a pointer: ```go var v Vertex ScaleFunc(v, 5) // Compile error! ScaleFunc(&v, 5) // OK ``` while methods with pointer receivers take either a value or a pointer as the receiver when they are called: ```go var v Vertex v.Scale(5) // OK p := &v p.Scale(10) // OK ``` For the statement `v.Scale(5)`, even though `v` is a value and not a pointer, the method with the pointer receiver is called automatically. That is, as a convenience, Go interprets the statement `v.Scale(5)` as `(&v).Scale(5)` since the `Scale` method has a pointer receiver. The equivalent thing happens in the reverse direction. Functions that take a value argument must take a value of that specific type: ```go var v Vertex fmt.Println(AbsFunc(v)) // OK fmt.Println(AbsFunc(&v)) // Compile error! ``` while methods with value receivers take either a value or a pointer as the receiver when they are called: ```go var v Vertex fmt.Println(v.Abs()) // OK p := &v fmt.Println(p.Abs()) // OK ``` In this case, the method call `p.Abs()` is interpreted as `(*p).Abs()`. ## Range and Close A sender can `close` a channel to indicate that no more values will be sent. Receivers can test whether a channel has been closed by assigning a second parameter to the receive expression: after ```go v, ok := <-ch ``` `ok` is `false` if there are no more values to receive and the channel is closed. The loop `for i := range c` receives values from the channel repeatedly until it is closed. **Note:** Only the sender should close a channel, never the receiver. Sending on a closed channel will cause a panic. **Another note:** Channels aren't like files; you don't usually need to close them. Closing is only necessary when the receiver must be told there are no more values coming, such as to terminate a `range` loop. **Example:** ```go package main import ( "fmt" ) func fibonacci(c chan int) { x, y := 0, 1 for i := 0; i < cap(c); i++ { c <- x x, y = y, x+y } close(c) } func main() { c := make(chan int, 10) go fibonacci(c) for i := range c { fmt.Println(i) } } ```