Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Metaprogramming/Go/metaprogramming.go
Normal file
24
Task/Metaprogramming/Go/metaprogramming.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type person struct{
|
||||
name string
|
||||
age int
|
||||
}
|
||||
|
||||
func copy(p person) person {
|
||||
return person{p.name, p.age}
|
||||
}
|
||||
|
||||
func main() {
|
||||
p := person{"Dave", 40}
|
||||
fmt.Println(p)
|
||||
q := copy(p)
|
||||
fmt.Println(q)
|
||||
/*
|
||||
is := []int{1, 2, 3}
|
||||
it := make([]int, 3)
|
||||
copy(it, is)
|
||||
*/
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue