Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf59836
Fix #33 - https://tour.golang.org/moretypes/1
Muh-Sidik Feb 6, 2020
ccb54e3
Fix #33 - https://tour.golang.org/moretypes/2
Muh-Sidik Feb 6, 2020
30a9dcb
Fix #33 - https://tour.golang.org/moretypes/3
Muh-Sidik Feb 7, 2020
2cd5dec
Fix #33 - https://tour.golang.org/moretypes/4
Muh-Sidik Feb 7, 2020
6d79235
Fix #33 - https://tour.golang.org/moretypes/5
Muh-Sidik Feb 7, 2020
96c7644
Fix #33 - https://tour.golang.org/moretypes/6
Muh-Sidik Feb 7, 2020
04fe945
Fix #33 - https://tour.golang.org/moretypes/7
Muh-Sidik Feb 7, 2020
714ac4a
Fix #33 - https://tour.golang.org/moretypes/8
Muh-Sidik Feb 7, 2020
fe4e287
Fix #33 - https://tour.golang.org/moretypes/9
Muh-Sidik Feb 7, 2020
aa422b8
Fix #33 - https://tour.golang.org/moretypes/10
Muh-Sidik Feb 7, 2020
4853ead
Fix #33 - https://tour.golang.org/moretypes/11
Muh-Sidik Feb 7, 2020
48c390c
Fix #33 - https://tour.golang.org/moretypes/12
Muh-Sidik Feb 7, 2020
f5f8b35
Fix #33 - https://tour.golang.org/moretypes/13
Muh-Sidik Feb 7, 2020
51bca6b
Fix #33 - https://tour.golang.org/moretypes/14
Muh-Sidik Feb 7, 2020
62052b0
Fix #33 - https://tour.golang.org/moretypes/15
Muh-Sidik Feb 7, 2020
9c01247
Fix #33 - https://tour.golang.org/moretypes/16
Muh-Sidik Feb 7, 2020
eb528b6
Fix #33 - https://tour.golang.org/moretypes/17
Muh-Sidik Feb 7, 2020
1dcb076
Fix #33 - https://tour.golang.org/moretypes/18
Muh-Sidik Feb 7, 2020
c79a09f
Fix #33 - https://tour.golang.org/moretypes/19
Muh-Sidik Feb 7, 2020
3075dcc
Fix #33 - https://tour.golang.org/moretypes/20-21
Muh-Sidik Feb 9, 2020
800cc02
Fix #33 - https://tour.golang.org/moretypes/22
Muh-Sidik Feb 9, 2020
a0ea997
Fix #33 - https://tour.golang.org/moretypes/23-24
Muh-Sidik Feb 9, 2020
2029834
Fix #33 - https://tour.golang.org/moretypes/18
Muh-Sidik Feb 11, 2020
cc76b5a
Fix #33 - https://tour.golang.org/moretypes/23
Muh-Sidik Feb 12, 2020
8b26ba2
Fix #33 - https://tour.golang.org/moretypes/23
Muh-Sidik Feb 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions sidik/moretypes_18.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package sidik

// import "golang.org/x/tour/pic"
import (
"golang.org/x/tour/pic"
)

// func Pic(dx, dy int) [][]uint8 {
// return x*y
// }
func Pic(dx, dy int) [][]uint8 {
return dx, dy
}

// func type18() {
// pic.Show(Pic)
// }
func type18() {
pic.Show(Pic)
}
13 changes: 13 additions & 0 deletions sidik/moretypes_23.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package sidik

import (
"golang.org/x/tour/wc"
)

func WordCount(s string) map[string]int {
return map[string]int{s: 1}
}

func type23() {
wc.Test(WordCount)
}
21 changes: 21 additions & 0 deletions sidik/moretypes_24.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package sidik

import (
"fmt"
"math"
)

func compute(fn func(float64, float64) float64) float64 {
return fn(3, 4)
}

func type24() {
hypot := func (x, y float64) float64 {
return math.Sqrt(x*x + y*y)
}

fmt.Println(hypot(5, 12))

fmt.Println(compute(hypot))
fmt.Println(compute(math.Pow))
}
2 changes: 2 additions & 0 deletions sidik/sidik.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func Main() {
type20()
type21()
type22()
// type23()
type24()
}

func basic1() {
Expand Down