在go的src目录下创建包路径:mytest
创建mytest.go
package mytest
/*方法名首字母要大写*/
func NxyTest() {
fmt.Println("this is my test")
}
编写测试demo
package main
import (
"fmt"
"mytest"
)
func main(){
fmt.Println("begin")
mytest.NxyTest()
}
在go的src目录下创建包路径:mytest
创建mytest.go
package mytest
/*方法名首字母要大写*/
func NxyTest() {
fmt.Println("this is my test")
}
编写测试demo
package main
import (
"fmt"
"mytest"
)
func main(){
fmt.Println("begin")
mytest.NxyTest()
}