update module

master
ZGGSONG 3 years ago
parent 6e253612ea
commit 0a7a9c2b45

@ -0,0 +1,17 @@
package calc
func Add(a, b float64) float64 {
return a + b
}
func Sub(a, b float64) float64 {
return a - b
}
func Mult(a, b float64) float64 {
return a * b
}
func Divi(a, b float64) float64 {
return a / b
}

@ -0,0 +1,3 @@
module moduledemo
go 1.17

@ -0,0 +1,15 @@
package main
import (
"fmt"
"moduledemo/calc"
)
func main() {
var a, b float64
a, b = 6, 3
fmt.Println(calc.Add(a, b))
fmt.Println(calc.Sub(a, b))
fmt.Println(calc.Mult(a, b))
fmt.Println(calc.Divi(a, b))
}
Loading…
Cancel
Save