Исходники и презентации
This commit is contained in:
20
lessons/interfaces/interface_assignment/main.go
Normal file
20
lessons/interfaces/interface_assignment/main.go
Normal file
@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
type A interface {
|
||||
Do()
|
||||
}
|
||||
|
||||
type B interface {
|
||||
Do()
|
||||
}
|
||||
|
||||
func main() {
|
||||
var a A
|
||||
var b B
|
||||
|
||||
// Does not work with
|
||||
// different packages
|
||||
|
||||
a = b
|
||||
b = a
|
||||
}
|
||||
Reference in New Issue
Block a user