tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
21
Task/Null-object/Go/null-object.go
Normal file
21
Task/Null-object/Go/null-object.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
var (
|
||||
s []int // slice type
|
||||
p *int // pointer type
|
||||
f func() // function type
|
||||
i interface{} // interface type
|
||||
m map[int]int // map type
|
||||
c chan int // channel type
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(s == nil)
|
||||
fmt.Println(p == nil)
|
||||
fmt.Println(f == nil)
|
||||
fmt.Println(i == nil)
|
||||
fmt.Println(m == nil)
|
||||
fmt.Println(c == nil)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue