diff --git a/example/helper.go b/example/helper.go new file mode 100644 index 0000000..93fe099 --- /dev/null +++ b/example/helper.go @@ -0,0 +1,5 @@ +package main + +func privateHelperFunc() int { + return 25 +} diff --git a/example/main.go b/example/main.go new file mode 100644 index 0000000..b12142c --- /dev/null +++ b/example/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" + "example/math" + "util" +) + +func main() { + fmt.Println("Hello world! My lucky number is", math.Mul2(privateHelperFunc())) + fmt.Println("Square:::", util.Square(60)) +} diff --git a/example/math/math.go b/example/math/math.go new file mode 100644 index 0000000..82c2833 --- /dev/null +++ b/example/math/math.go @@ -0,0 +1,5 @@ +package math + +func Mul2(x int) int { + return x * 2 +} diff --git a/util/main.go b/util/main.go new file mode 100644 index 0000000..c97df74 --- /dev/null +++ b/util/main.go @@ -0,0 +1,15 @@ +package util + +import "math" + +func Square(x float32) float32 { + return x * x +} + +func Circle(r float32) float32 { + return math.Pi * r * r +} + +func cube(x float32) float32 { + return x * x * x +}